Friday, 29 January 2010

Shaders and kuju materials - AddATex

AddATex is the material we use for additive glows. Example uses include glows around bulbs, glows around headlights and glows on surfaces (from streetlights).

As this effect is additive, these effects are visible both day or night, but are more effective and more visible at night. For our example, we'll consider a streetlight.


Here you can see the streetlight asset with a night time node. This node will simply switch on (become visible) at night time.

If you examine the 3DSMax wireframe view, you can see that there are two glows contained in this asset, one upper glow centred around the bulb and one lower glow on the floor itself. Both of these glows use the AddATex material but with slightly differing properties.

The bulb glow needs to always face the camera, so that it gives the effect of a simple lens flare. This will need to have the 'VIEW FACING' flag ticked in the material.

The floor glow needs to be static and remain in position, and therefore should use the default 'NOT VIEWER FACING' flag.

Our two AddATex materials are detailed below. The material on the left is for the bulb glow and the material on the right is for the floor glow. Notice the viewer facing flags in the materials.

Also note that as these materials use alpha, the Z-Buffer mode is set to 'TEST ONLY' in both. This ensures the materials render correctly.



Example textures :

4 comments:

  1. That's the whole secret of glowing effects at signals? Not really, or? :):):)

    The function of viewer facing in combination with AddATex isn't available in 3D Canvas :(

    ReplyDelete
  2. PS.: I like your Tutorials very much. They are very appreciated. Thank you for sharing your knowledge.

    ReplyDelete
  3. the object face appers to be transparent where i Have set this shader.what is wrong??I have set transparency to 0

    ReplyDelete
  4. Please help. I want a video tutorial for this shader and streetlight tutorial

    ReplyDelete