Trying to do a very simple shader that renders the interpolated vertex colors only - no lighting - no shading - nothing.
Is there a specific shader I should use, or if I created one what should it look like?
Trying to do a very simple shader that renders the interpolated vertex colors only - no lighting - no shading - nothing.
Is there a specific shader I should use, or if I created one what should it look like?
Try this:
Shader "Vertex Colors" {
SubShader {
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
Pass {
}
}
}
Also any of the particle shaders will work as well.
Heya - this is great, almost exactly what I need for my vertex baked lighting on iPhone - but I need to be able to multiply it by a texture - and my ShaderFu isn’t good enough - spent a while reading the docs and trying to splice together different parts of different shaders to no avail? Any hints on how to do this (shader code or links so I can learn it myself would be great!)
Thanks
-jdm
I have this shader; haven’t tried it on the iPhone though:
Shader "Vertex color unlit" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
}
Category {
Tags { "Queue"="Geometry"}
Lighting Off
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
// ---- Dual texture cards
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture * primary
}
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine previous lerp (previous) constant
}
}
}
// ---- Single texture cards (does not do vertex colors)
SubShader {
Pass {
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine texture lerp(texture) constant
}
}
}
}
}
–Eric
That worked on the iPhone, thanks!
Interestingly, I didn’t see any significant change in FPS using baked vertex colors for my lights over just using actual point lights in my scene, which tells me i’m probably not rendering-bound currently (or at least not vertex-lighting bound) - Are point lights on the iPhone significantly cheap due to the tile-based deferred renderer?
-jdm