- Home /
Question by
spaceshooter · Jan 21, 2011 at 07:51 PM ·
shadercubeedge
Transparent Cube with Colored Edge lines
How would I go about making a transparent cube with Colored Edge lines? So if an object was inside, it would look like it was surrounded by the edge lines of the cube.
Comment
Answer by synapsemassage · Feb 20, 2011 at 11:22 AM
You could use a shader with -culling off- and transparency. Then make a texture with only edges colored and rest is transparent. Map the texture to your cube faces. random shader example:
Shader "UnlitAlpha" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("Base (RGB) Trans. (Alpha)", 2D) = "white" { } }
Category
{
ZWrite On
Alphatest Greater 0.5
Cull Off
SubShader
{
Pass
{
Lighting Off
SetTexture [_MainTex]
{
constantColor [_Color]
Combine texture * constant, texture * constant
}
}
}
}
}