Hi,
I’m new to shaders and I’m trying to code a shader where the object repeat itself inside itself.
I’ve made a mockup of the desired effect.
*the red lines are there just for better visualization
Is it possible?
Thank you!
Hi,
I’m new to shaders and I’m trying to code a shader where the object repeat itself inside itself.
I’ve made a mockup of the desired effect.
*the red lines are there just for better visualization
Is it possible?
Thank you!
If I get what you mean, all you would have to do is duplicate the main shader pass multiple times, each with a size decrease in the vertex shader.
Pass {
CGPROGRAM
...
v2f vert (appdata v) {
v2f o;
v.vertex *= 0.25;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
return o;
}
...
ENDCG
}
Pass {
CGPROGRAM
...
v2f vert (appdata v) {
v2f o;
v.vertex *= 0.5;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
return o;
}
...
ENDCG
}
Pass {
CGPROGRAM
...
v2f vert (appdata v) {
v2f o;
v.vertex *= 0.75;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
return o;
}
...
ENDCG
}
Pass {
CGPROGRAM
...
v2f vert (appdata v) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
return o;
}
...
ENDCG
}
Something like that.