OpenGL D3DLIGHT8 range equivalent in OpenGL

This topic is 3901 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

In D3D there is a "Range" value for point lights, is there a way to emulate this in OpenGL? definition: Range Distance beyond which the light has no effect. The maximum allowable value for this member is the square root of FLT_MAX. This member does not affect directional lights. Thanks edit: I tried this but it just doesnt look the same as it does on d3d...
lights[index].constant_atten = light->Attenuation0;
lights[index].linear_atten = light->Attenuation1/light->Range;


Share on other sites
Nope.
You can scan the spec yourself which is at www.opengl.org

Share on other sites
Yeah that was the first thing I did. Unfortunately no such parameter exists in OpenGL for lighting.

quote d3d docs:

D = |VL|

In the preceding formula, D is the distance being calculated, V is the position of the vertex being lit, and L is the light source's position. If D is greater than the light's range, that is, the Range member of a D3DLIGHT8 structure, Direct3D makes no further attenuation calculations and applies no effects from the light to the vertex. If the distance is within the light's range, Direct3D then applies the following formula to calculate light attenuation over distance for point lights and spotlights.

A = 1/atten0 + D*atten1 + d^2*atten2

Now obviously without the ability to tell opengl that I want D = R if D > R I cannot reuse the same lighting data...soo it looks like its just not possible. Bummer.

Share on other sites
Actually, you could probably easily pull it off using shaders.

Share on other sites
This is true but I would prefer to use the fixed function pipeline =/

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 10
• 13
• 85
• 11
• 10
• Forum Statistics

• Total Topics
632969
• Total Posts
3009604
• Who's Online (See full list)

There are no registered users currently online

×