Home Technical Talk

ImageBasedLighting 3dsmax Fx

polycounter lvl 20
Offline / Send Message
CrazyButcher polycounter lvl 20
Orginally Brice made that BRDF shader for Maya as seen in http://boards.polycount.net/showflat.php?Cat=0&Number=238350
and http://www.mentalwarp.com/~brice/shader.php
after making the max port initially, I broke away from his codebase quite a bit, to make it easier to add/change things, and of course stuff that is more specific to 3dsmax. If you compare the files, you will see the shadersetups are completely different.

Due to the internal code differences / feature variations, I think it's better to do separate threads now. That way maya wishes/changes will be in the old thread, and max stuff should go here.
Anyway I know its a bit ugly having not one standardized shader for both max and maya, but I guess either of us wants to approach this topic in different ways, nor just wants to "port" the other's work wink.gif For both of us it's a learning experience how to setup the code generation in a optimal way.

So here is a new version of the 3dsmax one. http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf

The main new things compared to last version is, that I added cavity detection. It is still very simple and depends on mesh topology, due to the function used (which allows single pass rendering). It also changes with viewdistance. This is due to the derivative function used in the shadercode, which works on pixelgroups in screenspace. When time allows again I will try to come up with smoother cavities, likely going to be multipass rendering. But you are used to faceted look of stuff in zbrush anyway wink.gif There is a switch now that allows the BRDF Textures to be mixed on cavity or like before a mask texture.
I also split away the reflection being linked to specular (although that would be physically more correct, as Brice did), and added a dedicated reflection map (as it seemed a popular demand, EQ bitch).
"specular power" texture was removed and that value is now stored in specular.alpha
Baked Lighting can be either passed as VertexColor or with texture, that uses its own UV channel. Note that the latter will not work in the ps2_0 versions of the shader.

A more or less complete list of the features:
* Image Based Lighting based on Light/Normal angle and View/Normal angle with BRDF Texture
* Mixing between two BRDF Textures
** via Weight Texture
** via Cavity
* Normalmap
* Colored Diffuse, Specular, Emissive, Environment Reflection, Reflectivity textures
* Specular.alpha encodes "power"
* Reflectivity.alpha encodes "blur" influence
* AmbientLighting with
** CubeMap
** Hemispheric between 2 colors (ground/sky)
* AmbientOcclusion/LightMap mixing encoded in
** dedicated Texture using second UV Channel
** VertexColor
* Lots of tweakables/colorpickers for additional changes
* 1 or 3 Lights
* Basic shader versions for old cards (Radeon9600)

cavity test (set to full bright green)
brdf_cavity.jpg
death star vs borg cube

future plans:
the subsurface scattering might be linked to a 2d image as well for full control.
experimenting with cavity smoothing.
the self-shadowing is a touchy topic. max versions prior to 08 seem to be very buggy with this. Maybe I can hack something together for single lights, but not such high priority.

Replies

Sign In or Register to comment.