View Full Version : How to define areas of reflections with an alpha channel/map?
redmotion
October 23rd, 2007, 14:18
I'm new to the software (seems like a great tool) and the forum, so Hi!!
At the moment I'm creating a shader that will hopefully be the main "workhorse" shader for a game engine. I would like to use textures with both stone and metallic elements and use an alpha channel or b&w map to define where a cubemap reflection occurs (on the metal areas) and where it does not (the stone areas).
I guess my question is what node or sequence of nodes should I use between a phong illumination node (result) and a texture2d (b&w image) and environment cubemap nodes that will exclude areas of the cubemapping?
Any advice about what combination of nodes might help with this would be great.
Many thanks,
Jase.
ruediger
October 24th, 2007, 09:47
Hello Jase,
here's a small setup how you can build this effect using an image which already contains the alpha channel you need.
You can easily extract the alpha using the "Conversion_color_to_scalars" node, convert that back to a BW color and multiply it with your reflection. The example image isn't looking too good, but I think you get the point how to do it.
Best Regards,
Ruediger
redmotion
October 25th, 2007, 09:18
Thanks for the info. Thats been really helpful. I've managed to add normalmapping into this to create quite a detailed shader. I'll happily post up a screen capture of the network it you think it may be useful to other users. Thanks again.
Mental mill is excellent by the way - it reminds me of XSIs mental ray shader networks.
(It is however, performing a little slowly. It might be that I'm using an ATI x1950pro AGP but it does seem to be working ok.)
ruediger
October 25th, 2007, 13:09
It is however, performing a little slowly. It might be that I'm using an ATI x1950pro AGP but it does seem to be working ok
Without going into details - the mill is still in the beta phase and performance is going to improve as we're developing the product.
The shader-network aproach isn't a new concept, since it is already used in applications like Softimage|XSI or Maya. Bringing it to realtime is needs a different approach though and we're quite excited that the mill is the first product in that field. We're glad to hear feedback about the application since we're continously improving the product to give the user the most comfortable tool to create effects with.
I'm looking forward to see your screenshots - feel free to post and share your results.
Best Regards,
Ruediger
redmotion
October 25th, 2007, 23:57
Without going into details - the mill is still in the beta phase and performance is going to improve as we're developing the product.
Ok, fair enough. This is really how DX shader creation should be (especially when the exported shaders work so well ... so far).
I'm also curious how or if it might work with other "non-material" fx like camera lens distortions, camera bloom, particles, heat hazes, etc.
Ok, I've posted a shader tree for my base shader which takes the one you posted previously and adds in normal mapping. Let me know your thoughts.
The other image is my first attempt at a phong/bumpmapped shader from MM inside the game engine.
Hope you like it! :)
ruediger
October 28th, 2007, 21:23
I'm also curious how or if it might work with other "non-material" fx like camera lens distortions, camera bloom, particles, heat hazes, etc.
About effects that are eventually part of HLSL or CgFX it's kind of difficuult to say how far these will be supported in mental mill. Mental mill is primarily a tool for easy and target language independent shadertree creation. Languages like GLSL don't support the same features like CgFX and HLSL.
For such effects we have to know what techniques are offered by the various shader languages, which can vary in the way that effects are created. We'd rather have to find a common denominator or offer sspecialized nodes that can be used for exporting to certain target languages only. Currently we are working to support a wide set of shader features and we might want to include such features as well.
Your results look pretty nice by the way. Using a phong shader for a rock surface and still have it not look like plastic proves that you surely know how to combine a feel for using the right textures and creating a nice network, using the right parameters. And as we know : a good shader effect is only convincing once you use both good textures and a good shader(network).
Best Regards,
Ruediger