- Home /
Modifying MirrorReflection2
I am using MirrorReflection2.
I notice that its MirrorReflection material (specifically the Reflection) is something similar like a blue sky. I use white as the "Base (RGB)" texture map.
How do I change it? I chose "Select" but it would not change.
Is it a cubemap? I created a cubemap as shown on http://unity3d.com/support/documentation/Components/class-Cubemap.html. I still could not change the reflection.
I am trying to replace it with something like a white stainless steel look.
Thanks in advance for your help.
UPDATE:
I found out why it has blue sky. It is because I am attaching a blue Skybox. It is reflecting it.
I still don't understand why I can not modify the _ReflectionTex texture but I can modify the _MainTex texture. Please see its Shader code below.
Shader "FX/Mirror Reflection" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_ReflectionTex ("Reflection", 2D) = "white" { TexGen ObjectLinear }
}
Answer by pion · Sep 09, 2011 at 11:46 PM
MirrorReflection.cs shows the following code snippet:
// Reflection render texture
if( !m_ReflectionTexture || m_OldReflectionTextureSize != m_TextureSize )
{
if( m_ReflectionTexture )
DestroyImmediate( m_ReflectionTexture );
m_ReflectionTexture = new RenderTexture( m_TextureSize, m_TextureSize, 16 );
m_ReflectionTexture.name = "__MirrorReflection" + GetInstanceID();
m_ReflectionTexture.isPowerOfTwo = true;
m_ReflectionTexture.hideFlags = HideFlags.DontSave;
m_OldReflectionTextureSize = m_TextureSize;
}
Notice the new RenderTexture( m_TextureSize, m_TextureSize, 16 ); line above. It explains why I couldn't modify the _ReflectionTex because it is being used to assign RenderTexture() during runtime.
Please let me know if the above explanation is incorrect.
Your answer
Follow this Question
Related Questions
Line Renderer Issues 1 Answer
Realtime reflection 1 Answer
Mirror to mirror usint reflection probes? 0 Answers
Best option to create real mirrors in terms of performance 2 Answers