Light HOW?

Started by
4 comments, last by nanik 22 years, 9 months ago
Hi all, I would like ask a simple question. Let''s say I did not like the DirectX or Opengl (or another) API''s or engine''s lightning structure, and I want to do this by msyself. How could I do this at the end? Ok. Bizzare question. I will explain. I have projected each point on to the screen, then using some math model I have calculated each intensities at these pixels. So how can I interact the intensity and the color information at each pixel? At first I think that RGB can be represented as Hue, Saturation and Intensity. So the OuputIntensity = LightIntensity* PixelColorIntensity is true or not?
Advertisement
Sorry for the second post. Opera browser game some error. I re-posted. And saw the second. Ggrrrr...
Turn off all the lights. Calculate your own colors at each vertex. And then send your desired color along with each vertex at drawing time.

Or, calculate the illumination as a texture map to be draped over your objects. This works best for static scenes.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
quote:Original post by bishop_pass
Turn off all the lights. Calculate your own colors at each vertex. And then send your desired color along with each vertex at drawing time.

Or, calculate the illumination as a texture map to be draped over your objects. This works best for static scenes.


Thanks for the answer bishop_pass, but I want to learn how to calculate the my own color for this case. I mean there is some color information for each vertex and I have light intensity. What is the correct way to interpolate them? This is somewhat different from the above though.
Well, you can still look at the OpenGL lighting specification.
In case of one light, i think it uses something like:

Vertex_color = Ambient_color + Attenuation * Light_color

Where Attenuation = 1 / ( a + b*D + c*D*D ),
D is the distance from the vertex to the light position,
and a,b & c are user-defined constants.

Y.
search for Gamma Faq, Color Faq (I think *.pdf)
look at the OpenGl GammaRamp

Arne

This topic is closed to new replies.

Advertisement