Forum: DAZ|Studio


Subject: Q: When is √(N*N)≠N ? A: In Shader Mixer when you play with normals!

3dcheapskate opened this issue on Oct 30, 2012 · 13 posts


3dcheapskate posted Wed, 31 October 2012 at 10:43 PM

Thanks for the reply - lots to think about there. Going through your reply paragragh at a time...

Quote - When rendering your scene, 3delight (DS's renderer) converts all your geometry to camera space. The camera space's origin is where your camera is located in the 3d scene. It has x pointing right, y pointing up, and z pointing away from the camera (which, btw is a left-handed coordinate system). As a result, faces that are visible by the camera have their normals point in the general direction of the camera, and because those faces are in front of the camera they point in the direction of the negative z-axis, hence they have usually a negative z value.

So DS Camera space uses a LH axis set while DS world space uses a RH axis set - is that correct? The mists are beginning to clear! I'll expand on this in the next post...

Quote - You have to be careful when manipulating normals in your shader in the way you did, like negation of a single component, because after that in general the resulting vector will not be a normal anymore; e.g. negating the z-component of a vector does not make it point into the opposite direction, for that you would have to negate all its components - so negating one component only does not necessarily make your render totally black.

I've been assuming that any old unit vector is interchangeable with a normal. Changing the sign of 1,2, or all 3 of the components of a unit vector will still give you a unit vector, and thus I assumed a valid normal - is this incorrect? (I realise that you'd need to change the signs of all 3 components to 'flip' the normal)

Quote - Note that the normals in the render depend on the s/t-parameters of the object (i.e. the UV-map). The little spheres you see in the preview windows of the shader mixer are of course mapped differently than the object you want to render, so do not rely on them to determine if everything works correctly.

For my tests I've been loading a single sphere primitive into the scene. I'd assumed that the brick preview renders were using a similar, if not identical, object and that the mapping would be the same or similar. Test renders that weren't totally black seemed to indicate that the mapping was similar enough.


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.

*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).