PDA

View Full Version : Light range



LanceMao
03-01-2010, 08:57 PM
Hi,
In tools like 3D Max, Unity3D, I see that the range of light can be adjusted. In Max, there is Inner range and outter range. I have no idea what does inner range mean.
I` m wondering how to implement this in OpenGL.

Thanks!

Ilian Dinev
03-01-2010, 09:08 PM
With fixed-func, you're limited to http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml , I guess.
With GLSL, you can try to approximate the 3ds light.

LanceMao
03-01-2010, 11:32 PM
Thanks. As I` m working on OpenGL ES, I think there is no SL at all

ZbuffeR
03-02-2010, 02:17 AM
Depends if it is GL ES 1.1 or 2.0 ...

dorbie
03-04-2010, 03:36 AM
Light range is a conceptual hack for optimization that has no basis in reality. You will only be able to support this is you have OpenGL ES 2.0 or other software tricks in OpenGL ES 1.x

Pierre Boudier
03-04-2010, 03:50 AM
one way to emulate light range with fixed function HW (es1.1), is to encode your range in an alpha texture, use world texgen to look it up, and alpha test your pixel if it is outside of the range.

however this requires multipassing if you want to still output some value for your pixel outside of the range.