x


Strongest Specular/Model_LightColor or bust

I have been writing a CG based shader that does operations on the _SpecularLightColor (or it could almost use the _ModelLightColor), and all is great as a Directional Light, but as soon as I switch to Spotlight or turn on another light, my shader disappears (or I completely lose the Specular contribution). And if its a point light then I lose my transparency (based on an alpha-map).

I've been going thru all the Spec shaders I can find but I cannot determine how to either specify to use the strongest (or only) direction light, or to allow all lights to contribute no matter what their type.

(FYI: I am using the _SpecuarLightColor0 convention to get the light response)

Any ideas?

more ▼

asked Aug 27 '10 at 12:31 AM

JBC gravatar image

JBC
26 4 5 7

ok, worked out the deal with the loss of transparency (see shaderlab forum), it's all about the lightattenuation(i) function to force the other lights to respond.

Sep 09 '10 at 06:34 AM JBC
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1655
x78

asked: Aug 27 '10 at 12:31 AM

Seen: 425 times

Last Updated: Aug 27 '10 at 12:31 AM