Jump to content
  • Advertisement
Sign in to follow this  
Chimaira

Lights are only affecting whole faces.

This topic is 4169 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

I have a 20*20unit wide plane and a diffuse lightsource that is located 3units above the plane. Right now, no matter how far from the light you go, the plane will be equaly lit everywhere. I want the light to falloff so the point on the texture that is straight under the light will be much brighter than a point in one of the edges of the plane. This image explains better :) Right now all i do to activate my light is this:
      renderingDevice.Lights[0].Type = LightType.Point;
            renderingDevice.Lights[0].Diffuse = Color.FromArgb(255, Color.White);

            renderingDevice.Lights[0].Position = new Vector3(0,3,0);

            renderingDevice.Lights[0].Range = 100;
            renderingDevice.Lights[0].Falloff = 1;
            renderingDevice.Lights[0].Enabled = true;

Share this post


Link to post
Share on other sites
Advertisement
How are you rendering this, fixed function or shaders?

If fixed function then you will need alot more vertices in the scene in order for the light to blend nicely. Fixed function lighting is per vertex.

Dave

Share this post


Link to post
Share on other sites
Dave, since Chimaira is setting light states, it can be assumed that we are talking about fixed-function pipeline here.

Chimaira, as Dave mentioned, with fixed-function you have per-vertex lights. In order to achieve what you explained in the image, you need either to subdivide your surface plane and cube mesh to have more vertices, or use shaders and program per-pixel lighting.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!