You can use a one instruction line : diffuseColor = tex2D(g_TopSampler,IN.UV0.xy);diffuseColor = (diffuseColor != 0) ? diffuseColor : float4(1,1,1,1); the ?: translates to 1 asm instruction
In case it helps, here's a quick pseudocode description of CrazyBump's shader (with parallax displacement omitted). All the vectors are in tangent-space. DiffuseColor = DiffuseTexture * (LightVector DOT NormalVector) SpecularColor = SpecularTexture * (HalfVector DOT NormalVector) ^ Gloss OutputColor = (DiffuseColor +…
The flag animation is just a simple 'vertex offset' shader with a panned gradient texture and the same texture is used for multiplying/darken the diffusecolor for fake shading. No 'use' of 'normal reconstruction'. I hope you like it! :)
Just testing my pipe materials. 2 textures for each color material. Same tiling diffuse(mostly pure white and a little bit of AO), detail normal, and spec/gloss. Just uses the DiffuseColor option to add the color.
Ben Apuna, its simple. If you are baking your lightmaps in a 3d package like max you can setup your lighting so it looks how you want it, then when you actually bake the lightmaps bake them 2 or 4 times darker than they were when you were preview rendering. You could probably do this easily with some exposure control in…
Instead of looping the scene materials, we can just collect all the materials of a class. In the following code you you need to replace standardmaterial with the class name of the VRay materials. You can get the class of a VRay material by applying it to an object and running this snip: classof $.material ( setProperty…
I'm getting the same issue with swatches.fbx from Quixel Suite 1.8, but with Blender. i.e. in the swatches provided for photoshop (Swatch.aco), the color for Varnished Wood is #c85300, but in the FBX file once imported into Blender, the color is #E59B00 which results in "Undefined" in Ddo. I converted swatch.fbx to ASCII…
So you're trying to Color Dodge the color, or in your recent example the PNG, on top of whatever is in the scene? It looks like you were on the right path then using the Post-Process shading model. The only issue is the SceneTexture node should use the PostProcess input. I forgot the name, but there's a couple of them,…
I would use a simple approach. Basically all you have to do is : ( 1 - glossiness ) * numofmipmaps. In my case it's 7. My setup : If your are using phong or blinn you might want to multiply your glossiness by 128 in order to get a range of 0 - 1 to avoid value like 180 or 200. But with a cook torrance or a spherical…