- Home /
how to make projector shader behave like vertex lit shader
hi i have an object that on selection has an marker projected on the ground with a projector. now is this marker a bit dark and i would like to brighten up this marker by making it emit light. only the standard shader for the projection are insufficient.
can someone help me to make the shader emit light, or is it just impossible with a projector.
an other option would be helpful.
Answer by bouke1 · Dec 12, 2011 at 04:00 PM
I've found a solution,
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
_FalloffTex ("FallOff", 2D) = "" { TexGen ObjectLinear }
}
Subshader {
Pass {
ZWrite off
Fog { Color (0, 0, 0) }
Color [_Color]
ColorMask RGB
Blend DstColor One
Offset -1, -1
SetTexture [_ShadowTex] {
combine texture + primary , ONE - texture //used to be multiply now is add
Matrix [_Projector]
}
SetTexture [_FalloffTex] {
constantColor (0,0,0,0)
combine previous lerp (texture) constant
Matrix [_Projector] //used to be _projectorClip
}
}
}
}
this is the projector light shader but modified
and the textures that was on the _fallofftex i changed it to my main texture, that has an alpha channel and the matrix of the falloftex has been changed to the same matrix as the _shadowtex
That is overcomplicated. I have no idea what you're trying to do; text is not enough to explain this. But if it works, it works. ;-) Regardless, you don't need to lerp to black. Lerping to black is the same as multiplying.
just modified the "projector/light" shader so that it works for me
Answer by Jessy · Dec 11, 2011 at 11:23 PM
There is no such thing as "light" in the innards of your 3D app's code. "Light" generally refers to RGB values that get multiplied into your main texture. Spotlights and projectors are essentially the same thing; the difference is, you deal with spotlights in the shaders that are used by individual objects' materials, and projectors blend the same material onto every object with which they interact. As such, spotlights offer more flexibility at the expense of complexity. You need to delve a little deeper into what is going on in your renders, and then decide what is appropriate.
im trying to get the projector texture behave the same way it would when it is put on a plane with a vertex lit shader with emissive set to white with full alpha.
Are you talking about an "unlit" shader? i.e. The projector will just project a texture that isn't affected by light? I doubt there's a point in having vertex lighting if all it's going to do is cause overbrightening. But if that's what you're going for, sure, use light. Otherwise, project this: http://www.unifycommunity.com/wiki/index.php?title=Texture_Only
the problem is that i use a projector that adds a texture to the existing one. and that one has (at the moment) no lighting. and for the projector to work it has to have a projector shader. or at least one that uses the components of that shader to work. but i think i have found a solution on my own and will post it below
Your answer
![](https://koobas.hobune.stream/wayback/20220613062004im_/https://answers.unity.com/themes/thub/images/avi.jpg)