i have some trouble with reflective unity materials. How to control the amount of reflection in ref. materials. When i make a material reflective it reflects like mirror. What i want is a reflection on a white glazed pot. The inspector says Alpha controls the amount of reflection, but it has no effect. I have even tried alpha in the image but that gave some very dark results... Am i wrong somewhere? What i want is to reduce the reflection amount from 100 percent to some 5 percent...
With Unity's built-in reflective shaders, you can reduce the amount of reflection by darkening the reflection color (Or, alternatively, increase it), using different reflection color values. If you mean the actual "Sharpness" of the reflections, much can be obtained by adjusting the glossiness to produce wider specular highlights, or by blurring the reflection texture (which can get restrictively expensive for realtime use)
Darkening the reflection color does not help...it will darken the whole detail, since i am using baked texture for the diffuse.What is the purpose of the refstrenth?
The contribution of the cube map is determined as follows: Code (csharp): half4 frag (v2f i) : COLOR { half4 texcol = tex2D (_MainTex, i.uv); half4 reflcol = texCUBE( _Cube, i.I ); reflcol *= texcol.a; return reflcol * _ReflectColor; } Which means: Code (csharp): reflectionColor = ReflStrength * ReflColor * ReflCubemap To reduce the reflection contribution, either darken the reflection colour (this will affect the entire surface), or darken the alpha channel in the spots where you want weaker reflection.
You using the beta? I doubt the shader works in it, because Blend AppSrcAdd AppDstAdd is deprecated. You can copy and paste the appropriate passes, instead of using the two UsePass statements, and use Blend One One in the second pass. This shader might not have been rewritten to use surface shaders yet. If that's true, until it is, it's possibly a workaround.
Thanx for all the replies... @Daniel Brauer - i have tried your suggestion of making an diffuse texture with alpha information.The reflection is according to alpha...but the rgb data of that image is not taken..for reflective diffuse,specular and vertexlit. For all other material types its considering the rgb
I think the problem you're encountering is that ambient light is not taken into account for reflective materials. Without any dynamic lights, your diffuse channel will be ignored.
(please note that I edited my post above for clarity while you were posting) The reflective shaders do not have a place for baked light. If you put it in diffuse, as you do above, you won't see anything without dynamic lights. You should be using light mapped shaders for any baked lighting.
Thanx for the help.... I thought of performance issues to do some baking as diffuse... is there any considerable difference between using diffuse and lightmap?
lightmap = 2 textures, one for diffuse, one for "shadow baked ontop of the diffuse" you can also use a diffuse with that but it means that: 1. diffuse can not be tiling 2. you will normally need much more texture space and textures due to it 3. the lightmap can only be grayscale (alpha channel) and you lose alpha material possibilities 4. you can not use the glow postfx as that bases on the alpha channel of the diffuse texture