- Home /
Shader Fusion (Detail-map, how to)
Hello, just purchased ShaderFusion so I'm a noob at it, but I got some shaders working with diffuse, normal, darkmaps etc.. However, I'm now trying to create a shader that uses a "detail-map" but I can't figure out how to do it. I need a diffusemap + detailmap + lighmap + normalmap etc.. but its the "detail-map" part I cant figure out. The blending mode of a detailmap is like "overlay" in photoshop where values over 128 get brighter and values under get darker.. but how do I achieve this result in Shader Fusion? Anyone?
Advice is greatly appreciated. /eX
Answer by skovacs1 · Dec 02, 2010 at 06:15 PM
This is a source for answers about Unity. Support for a Unity extension such as ShaderFusion will be hit-or-miss. I have no intention of teaching you how to use ShaderFusion or graph-based shader editors in general as that's not what UnityAnswers is for. For specific answers about that product, you should request further information from either the ShaderFusion blog or the person who made ShaderFusion.
I will answer this as more of a general "what sort of blending function should I use?" question. Detail maps are usually multiplied onto your diffuse map.: See the shader examples. The scaled multiplication you describe would be something like multiplying by (detailTex - 0.5) * 2.0. You might also consider lerping on the alpha of the detail texture to use that for opacity of your detail texture. You might also consider multiplying/adding your detail's rgb components separately and keeping the alpha of your diffuse untouched, but whatever blend function you use is really up to you.
I don't have ShaderFusion, but I would imagine to multiply, you would do something like create a texture node for your detail map, pass it to a uv1 node and then pass both of your textures' uv1 nodes into a multiply node, passing that into albedo.
To create a scaled multiplication as you describe, I imagine you would pass a Vector4 node of 0.5,0.5,0.5,0.0 to the B of a subtract node and the uv1 of your detail texture to the A of the subtract node and then pass the subtract node into the A of a multiply node and a number node of 2 to the B of the multiply node and then pass the multiply node into an addition node with the uv1 of your diffuse, passing the result into albedo.
I realize asking questions about 3rd party products will be hit or miss, but seeing the limited documentation on the official shader fusion site and considering 100% of SF users are likely to be Unity users I felt it's worth a try ;-) Thanx for your time and help, it's greatly appreciated.
/eX
Your answer
Follow this Question
Related Questions
How can I pass world position to a custom lighting function for a surface shader? 1 Answer
Creating a fogless version of a built-in shader 1 Answer
Strange, triangle shaped holes appearing in my applied shader. 1 Answer
Custom shader dissappear on mobile 0 Answers
What's faster? Two draw calls or a black/white alpha blend? 2 Answers