Forums > Jitter

twist shader no lighting

June 11, 2008 | 2:59 pm

Hi again,

I’m starting to understand the gist of the whole shader thing. I’ve
made a little ‘twist’-ish vertex shader but now I’m wondering where
my lighting went.
Files are here: http://www.visualantics.net/jitter/twist.zip
How can I get some light back on the object?

regards,
brecht.


June 11, 2008 | 3:51 pm

Lighting, textures, fog … are not passed through the processing pipeline
from open gl when you use shaders. This is why, in your twist shader, you
state how to draw the texture coordinates and which texture unit to use.
(Although in your patch you haven’t got a texture unit to load a texture).
If you want lighting you have to place some code in your shader. The Orange
book has numerous examples of lighting as does Jitter. Check them out to
see how to put light into your shader.

pelado

On Wed, Jun 11, 2008 at 4:59 PM, Brecht Debackere
wrote:

> Hi again,
>
> I’m starting to understand the gist of the whole shader thing. I’ve made a
> little ‘twist’-ish vertex shader but now I’m wondering where my lighting
> went.
> Files are here: http://www.visualantics.net/jitter/twist.zip
> How can I get some light back on the object?
>
> regards,
> brecht.
>

http://www.pelado.co.uk


Viewing 2 posts - 1 through 2 (of 2 total)