How can I achieve this with opengl lighting? I have a simple lighting system which I played with from an example that was on the forums using:
With that I was able to create a quick lighting system, but how would I create a simple shadow using these lights (rather than fake shadows via polygons)? Not looking for texture/sprite shadows, but being able to create walls with a couple vectors to cast a nice shadow, based on the light source.
Can someone provide a very small example of this, or a link to one?
glEnable GL_LIGHTING glEnable GL_LIGHT0 Global l0_diffuse:Float[] =[0.0, 1.7, 0.0, 1.0] glLightf GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.0 glLightf GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.001 glLightf GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.0001 l1_position[0] = 100 l1_position[1] = 100 glLightfv GL_LIGHT1, GL_POSITION, l1_position
With that I was able to create a quick lighting system, but how would I create a simple shadow using these lights (rather than fake shadows via polygons)? Not looking for texture/sprite shadows, but being able to create walls with a couple vectors to cast a nice shadow, based on the light source.
Can someone provide a very small example of this, or a link to one?