Wednesday, August 31, 2011

MetaSL based texturing tutorial with 3ds Max

Zoltan has created a very nice and elaborate tutorial about MetaSL based texturing in 3ds Max. Take a look and give it a try. During the series of articles, you will learn how to create this:


"This series of articles are about a texturing workflow and the related set of shader nodes called MUSH (MetaSL Utility Shaders). They allow the artist to texture up a mesh in high definition while keeping the artistic freedom to experiment and tweak the visuals in a simple way. These solutions are targeted mainly at game asset creators but might be useful to anyone who could live with the limitations of the methods."
- Zoltan

Part I: Overview
Part II: A basic example
Part III: Baking
Part IV: Displacement
Part V: An advanced example
Part VI: Tips and tricks
Part VII: Known issues
Part VIII: Node reference

If you like Zoltans work, also check out this article here:
http://www.zspline.net/blog/deposit-shader-in-mentalmill/

Friday, August 12, 2011

Water shader study

 Here is a study of a water shader that I created a little while ago. The shader is based on a simple idea of using a black and white height map and a normal map that defines the heightmap where the water will be and how the normals are oriented.


Download the project file here.


See the screenshot of the shader network inside the Phenomenon. Many parts could be wrapped into Phenomena themselves, but I leave that to the users as a practice.

This is a preview of the water shader network inside the Phenomenon. I broke up the network into sections (though some functionalities overlap, but I tried to give it a rough structure. See the  (Note that in the image one node does not belong to any section. This is because it does nothing, and I removed it from the final .xmsl that you can download from the mental mill blog)
How the effect is created (a rough overview)

Two different procedural perlin noises are combined to a float2 that is biased around 0 so that the values vary between -1 and 1. These values are used for
  • texture coordinate distortion (for the fake-refraction texture lookup)
  • caustic generation
  • water normal generation
A height map and a normal map that are both derived from the same source are used. The height map is used to calculate the water-falloff and the normal map provides the normal of the shape that 'contains' the water which is used for the diffuse shading.
The height information is used to create the falloff of the water (when it fades to the water color). Caustics are generated by using a special shader that is fed by the procedural float2 value.

All effects are finally combined and composited: Reflection, (fake) refraction, water color, caustics to generate the final look of the surface.

What to improve
The next things that would be interesting to do is, to find a way to replace the procedural waves with some cheaper normal textures that would save a massive number of instructions. However, this would raise the question how the caustics are generated, since this is done in a special shader.


Thursday, August 4, 2011

New debuggers for debugging within mental mill

I have created a set of Phenomena that assist you in debugging Colors and float2 as well as float parameters. The float debugger is basically the same as built into mental mill, but you are encouraged to open the Phenomenon and study what's inside there. The details are all described in the entry on the forum. Feel free to disassemble the Phenomenon and pull it apart, enhance it or create your own flavors.
Especially the color debugger has been enhanced and has more options than the built-in color debugger. It is more readable than the color encoding of the built-in debugger.

Here is the location where you can also download the mental mill 1.1 project file:
http://forum.mentalimages.com/showthread.php?8616-Debugging-colors-floats-and-float2s



Color debugger: Shows when colors are above or below a given limit in red and blue. Components can be turned on and off and the behavior for the color overlay can be toggled: Either ALL components must exceed in order to show a color overlay or it is enough that ANY component exceeds in order to show a red/blue overlay. The other outputs of the debugger Phenomenon show a compressed view of the colors and the luminance.


Float debugger: Works basically like the built-in preview window debugger, but shows colored overlays instead of just clamping or repeating the values.

float2 debugger: debugs float2 parameters and shows a colored overlay where values go beyong or below the min/max range. Additionally it outputs the length as a float value.