Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nanik

Light HOW?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Sorry for the second post. Opera browser game some error. I re-posted. And saw the second. Ggrrrr...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
search for Gamma Faq, Color Faq (I think *.pdf)
look at the OpenGl GammaRamp

Arne

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!