- Home /
reflection for iphone
i am applying a cubemap, reflection is not affected for object(cars..).
please help, how to follow the procedure .
by
Reflaction is a truly new thing to me. I suspect you meant 'Reflection' rather than 'Refraction'. Although I guess you could call the combination 'Reflaction'.
Answer by yourserb · Apr 19, 2010 at 05:53 AM
Hi,
Try this Shader for reflection ,but in iphone i think we cant get real time reflection, u can use this shader get the reflection image from Max or Maya.
Shader "iPhone/lightmap/reflective" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("Base (RGB)", 2D) = "white" {} _LightMap ("Lightmap (RGB)", 2D) = "white" { LightmapMode } _Reflect ("Reflection", 2D) = "black" { TexGen SphereMap } }
SubShader
{
Pass
{
Name "BASE"
BindChannels {
Bind "Vertex", vertex
Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
Bind "texcoord", texcoord1 // main uses 1st uv
}
SetTexture [_LightMap] {
combine texture
}
SetTexture [_MainTex] {
combine texture * previous
}
}
/* This pass uses vertex information to control Reflection
Pass
{
Name "REFLECT"
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMaterial AmbientAndDiffuse
Lighting Off
BindChannels {
Bind "Vertex", vertex
Bind "normal", normal
}
SetTexture [_Reflect] {
combine texture, primary
}
}*/
// Use this pass, if you want to fetch alpha from main texture instead
Pass
{
Name "REFLECT"
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
BindChannels {
Bind "Vertex", vertex
Bind "normal", normal
Bind "texcoord", texcoord0 // main uses 1st uv
}
SetTexture [_MainTex] {
combine texture
}
SetTexture [_Reflect] {
combine texture, previous
}
}
}
}
Answer by donzen · Mar 14, 2012 at 12:22 PM
How is possibile to change the shader to works with Beast lightmapper?
Your answer
Follow this Question
Related Questions
Top down light map as a environment map for the main character/Player? 0 Answers
Iphone Shader Reflection Map 0 Answers
Reflection property 1 Answer
Reflections in iphone 2 Answers
Serialization reflection ExecutionEngineException on iPhone 1 Answer