Advertisement Jump to content
Sign in to follow this  

Real-time per-pixel lighting demo

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

Hey guys, Here's a cool demo for you to try... GLSL lighting. Per-pixel positional diffuse This one is per-vertex directional diffuse. Not much difference in quality to per-pixel because there's a high vertex count Per-pixel positional specular. I've got to play with the specular shader a bit, it's nowhere near shiny enough. Per-pixel positional diffuse Per-vertex positional diffuse... colored green :) Per-pixel positional specular... colored blue :) This is real-time GLSL shading. I've implemented directional, positional, per-pixel, per-vertex, diffuse and specular lighting. With this demo you may mix and match any combination of those features to see how they look and perform, and I've included a map and a landscape model for you to switch between to provide different scenarios for the lighting simulation. I also allow you to dynamically change almost every lighting parameter; the color, the specular exponent value, the distance attenuation factor and more. I even allow you to tap the up and down arrows to change the texture on the fly. Note the required shaders that your video card will need to implement: GL_ARB_vertex_shader, GL_ARB_fragment_shader, GL_ARB_shader_objects, GL_ARB_shading_language_100 Grab it from my site Here's a direct link Let me know how it goes, I'm gunna go play with my specular code ... I'm not happy with it currently.

Share this post

Link to post
Share on other sites
Successfully tested on the following cards so far...

nVidia GeForce 7300SE/7200 GS
ATI Radeon X300/X550/X1050 Series

Failed to work on the following...

Mobile Intel(R) 915GM/GMS, 910GML Express Chipset

[Edited by - DamianOmen on June 23, 2008 8:56:46 PM]

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!