Difference between revisions of "Spherical Normal maps"

From Second Life Wiki
Jump to navigation Jump to search
(I just noticed a few missing basics that make this simpler. it was also an error with an outdated viewer version)
Line 3: Line 3:
----
----


== Your texture must be rotated 90° sideways to work with a spherical prim and SCULPT_TYPE_SPHERE: ==  
== Planar sculpt maps work just fine on all [[PRIM_SCULPT_TYPE_SPHERE]] sculpted prims ==


'''To work on a spherical prim, the height map for your normal map needs to be rotated rotated by 90°''' counter clockwise before you turn it into a normal map. (90° clockwise may work as well) Otherwise the north pole of an earth map on a spherical prim would not be on the pole of a spherical prim face! You can not rotate a normal map on a prim in post without changing the way that it reflects light. A 180° rotation of a normal map within SL turns a hill into a valley!
[http://secondlife.com/app/image/3e9211d6-c42d-a9ff-95b9-5c1ab349ed38/2 3e9211d6-c42d-a9ff-95b9-5c1ab349ed38] or [http://secondlife.com/app/image/1e266b9c-f842-865f-9eb2-39b43e30cb75/2 1e266b9c-f842-865f-9eb2-39b43e30cb75]  
This also applies for [[PRIM_SCULPT_TYPE_SPHERE]] spherical sculpted prims.


A bump/hill on your (unfinished) normal map should have green on the upper side, blue on the left side and flat terrain should be bright red. This map would work nicely on a flat texture. But it will not work on spherical faces.
Using .werkkzeug3 [https://mega.co.nz/#!s0UHSKTJ!BqybVjWr8wdfYTNePdS5bhonAJkZh3P_2YAvPEtCvVU] to make these normal maps for spherical prims needs the following command chain:


----
(double right klick in the lower window to add a function, they are chained from top to bottom loke these functions:)


* Import: (a .png height map image that has the north pole facing up and that has high parts white and low parts black)
* Color: "Mode" set to "invert" (most normal maps in .werkkzeug need inverted height maps.)
* Rotate: With "angle" set to 0.250, rotating 90° to the left.
* Normal: 3d (flat will be red, hills are green on the lower side)
* HSCB: With 0.800 as "hue" parameter, making "flat" PURPLE.


== All spherical normal maps need hue-shifted (by -90 if "flat" is bright red": ==
----


''' To work on a spherical face or on a (spherical) sculpted prim, a normal maps image needs to be shifted in its HUE by -90''', -1/4 of a full hue rotation.
== A [[PRIM_TYPE_SPHERE]] normal map for a sphere prim must be rotated by 90°:==


Flat terrain should now be purple, the upper left side of a bump should now be green, the upper right side should be red and the lower side should be blue.
but green must still be on the upper side of a hill like here: [http://secondlife.com/app/image/ab6adc27-e101-9d3a-1097-088104c1f607/2 ab6adc27-e101-9d3a-1097-088104c1f607]  
This is necessary for spherical faces/prims and [[PRIM_SCULPT_TYPE_SPHERE]] spherical sculpted prims.


----
Its flat normal-color is bright blue.
green must be on top of ah hill.
red must be in the lower right of a hill.
blue must be in the lower left of a hill.


== Illustrating Example ==
Using .werkkzeug3 to make these normal maps for spherical prims needs the following command chain:


A flat normal map [http://secondlife.com/app/image/1a6c1313-8042-62cb-8b59-5f30bbfbc47e/2 1a6c1313-8042-62cb-8b59-5f30bbfbc47e] on a prim-sphere will have a light source cast no light "south" of it (assuming an earth-map and mostly flat terrain) and have all flat/ocean terrain north of it 100% illuminated.
* Import: (a .png height map image that has the north pole facing up and that has high parts white and low parts black)
* Normal: 3d (flat will be red, hills are green on the lower side)
* Rotate: With "angle" set to 0.250, rotating 90° to the left.
* HSCB: With 0.600 as "hue" parameter, making "flat" blue.


A spherical normal map on a prim-sphere [http://secondlife.com/app/image/1e266b9c-f842-865f-9eb2-39b43e30cb75/2 1e266b9c-f842-865f-9eb2-39b43e30cb75] on a sphere will work properly. The same spherical normal map will work on [[PRIM_SCULPT_TYPE_SPHERE]], you just have to rotate the normal map by 270 (or 90) within SL's normal map settings. [http://i.imgur.com/g1hm0cz.jpg]
(there is no "Color: invert" here and we rotate AFTER makign the normal map!)

Revision as of 11:30, 28 August 2014

Normal maps for spherical prims/faces and spherical sculpted prims PRIM_SCULPT_TYPE_SPHERE are different and involve some more/different steps: [1]


Planar sculpt maps work just fine on all PRIM_SCULPT_TYPE_SPHERE sculpted prims

3e9211d6-c42d-a9ff-95b9-5c1ab349ed38 or 1e266b9c-f842-865f-9eb2-39b43e30cb75

Using .werkkzeug3 [2] to make these normal maps for spherical prims needs the following command chain:

(double right klick in the lower window to add a function, they are chained from top to bottom loke these functions:)

  • Import: (a .png height map image that has the north pole facing up and that has high parts white and low parts black)
  • Color: "Mode" set to "invert" (most normal maps in .werkkzeug need inverted height maps.)
  • Rotate: With "angle" set to 0.250, rotating 90° to the left.
  • Normal: 3d (flat will be red, hills are green on the lower side)
  • HSCB: With 0.800 as "hue" parameter, making "flat" PURPLE.

A PRIM_TYPE_SPHERE normal map for a sphere prim must be rotated by 90°:

but green must still be on the upper side of a hill like here: ab6adc27-e101-9d3a-1097-088104c1f607

Its flat normal-color is bright blue. green must be on top of ah hill. red must be in the lower right of a hill. blue must be in the lower left of a hill.

Using .werkkzeug3 to make these normal maps for spherical prims needs the following command chain:

  • Import: (a .png height map image that has the north pole facing up and that has high parts white and low parts black)
  • Normal: 3d (flat will be red, hills are green on the lower side)
  • Rotate: With "angle" set to 0.250, rotating 90° to the left.
  • HSCB: With 0.600 as "hue" parameter, making "flat" blue.

(there is no "Color: invert" here and we rotate AFTER makign the normal map!)