Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

Shadow Mapping with GLSL and NO frame buffer

This topic is 3324 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've been searching online for about a week now on implementation of shadow mapping with GLSL but not using frame buffers and I can't really find anything that has it. Maybe I missed something but could someone point me in the right direction or post some code? The only thing I have to work with now is this code to set up the depth map texture: <source> glGenTextures( 1, &m_shadowMap ); glBindTexture( GL_TEXTURE_2D, m_shadowMap ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY ); glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, size.X, size.Y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL ); </source>

Share this post


Link to post
Share on other sites
Advertisement
Why not design your own implementation of shadow mapping by extending points from a type of light source? For instance, if you have a cone light shining on a cube you could say when they collide extend the cone light vertices as a shadow until it reaches the ground. Obviously there would be a lot of math calculations involved depending on the angles and what not. Just an idea though. I don't know much about GLSL or frame buffers.

"He who is On the River will succeed."

Share this post


Link to post
Share on other sites
That implementation, from what I've read is shadow volumes. I want to stay away from that because it's not very efficient when dealing with big scenes with 100K+ vertices...

Share this post


Link to post
Share on other sites
Yes, your right. But Riveron, what else can you do? Would the GLSL not do the exact same thing but in its own way? It probably has better access to fast memory which makes it fast. If you could have the same access it would do the same thing, probably.

Share this post


Link to post
Share on other sites
GLSL would not do the same thing. Shadow volumes, you're pretty much taking the number of vertices in your scene and adding 2n more vertices (where n is the number of vertices). GLSL, you're passing n vertices and fragments for the polygons, which is being done anyway through the fixed pipeline, but just doing a little more math per vertice and fragment to calculate the shadow.

I want to do shadow mapping anyway, implementation is a choice; there are several ways to do the same thing and for my engine I would like to do shadow mapping with GLSL and no frame buffer. Thanks for the suggestion though.

Share this post


Link to post
Share on other sites
WEll sh*t duDe, just write your own OpenGL aDd-on and make that shIt if you know how it works. Christ, if you know how it works why not hit up Khronos' wEb site for support?

P.S. There is a secret message in this post. LOL. BTW, are you half retarded?

Share this post


Link to post
Share on other sites
Any moderator,

Please ban "Programmer K". He is really sick who has problem to tell the different between his imagination and the reality.

Share this post


Link to post
Share on other sites
BloodLust666, the following link is an article about shadow mapping implementation. And, it is not using FBO.

http://dalab.se.sjtu.edu.cn/~jietan/shadowMappingTutorial.html

By the way, everyone is using FBO now. Why you want a shadow mapping implementation without FBO?

Share this post


Link to post
Share on other sites
Wow just because I give someone some personal advice someone else wants me banned from Hong Kong no less? Listen up Japan...suck my balls.

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.

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

Sign me up!