Recommended Posts

Hi!
I'm programming cascaded shadow maps for outdoor lighting. I'm following this opengl example:
You can find the code here:

Code is pretty self [color=#000000][font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3][background=rgb(250, 250, 250)]explanatory but I have a question. [/background][/size][/font][/color]
[size=3][font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][color=#000000]In order to get the near and far plane for every frustum, code says that we have to [/color][/font][/size]make sure that all relevant shadow casters are included into one unique shadow map. I mean when computing the farPlane and the near plane that define the current shadow map's frustum, if half an object is at one side of the far plane and the other part is at the other side, we have to recompute the farPlane to make sure that the object is completely inside one unique frustum.
Is that really necessary if we want to implement cascaded shadow maps? because to me that's a a pain in the neck. what if I skip that part of the algorithm?
Thanks

Share on other sites
No, that would be impossible. As the player moves you would never be able to guarantee that your near frustum in their diagram will never cut an object up. I didn't find the part you referred to in that paper about uniqueness, but you will have to draw the object 2 times for the case of bleeding from the near to the far. Imagine if you had a giant forest, theres no way to adjust your frustum so that every tree is completely in the near OR completely in the far.

Share on other sites
I mentioned this in one of the other cascaded shadow mapping threads, but do give [url="http://www.cspaul.com/wiki/doku.php?id=publications:Rosen.2012.I3D"]adaptive shadow maps through rectilinear texture warping[/url] a gander. It only uses one map/'cascade' so lots of the cascaded shadow mapping edge cases aren't necessary. You can definitely get superior quality and possibly speed on top of it

Share on other sites
2 issues I have with that video. I would like to see a non checkered ground scene and also not a flat ground because flat ground makes basically 0 shadows at distance no matter what method you use because 1 pixel steps at far distances (relative to a viewer who is 6 feet tall) could cover hundreds of feet from their viewpoint. So you need hills and other objects at far distances. The other issue, you have to render it every single frame. When I do cascades that cover very far distances with tons of trees and other things, I don't want to render it all every frame. So I have several cascades that are far away and only get updated when the player travels say 100 feet, then I take 1 snapshot again, and wait till they move another 100 feet from there. I supposed the local map closest to the player could use a method like you have posted to warp the shadow map, but you have not provided enough in that demo to say you only need 1 shadow map. So you need thousands more trees and better ground to fully prove it that is going to look good or not, and how you can keep framerates down with realistically big scenes.

Share on other sites
That's actually the point of the algorithm. It's actually enlarging or shrinking regions on the shadow map based on how important they are to the final scene-- in the case you mention, the RTW warp maps would 'steal' some resolution from the surrounding/unimportant areas (say, stuff cast on scene backfaces or not in the view frustum outright) and use that for areas that are actually visible. With some tweaking, you could probably get uniform sampling density across the image!

Re: amortization-- True, this is an advantage of cascaded shadow maps. On the other hand, you don't need to do extra processing to determine which shadow map slice your objects will occupy or doing edge case handling when it straddles boundaries. Profile for your use case?

EDIT: There are some trees towards the end of the vid-- I think they hold up pretty well

Create an account

Register a new account

• Forum Statistics

• Total Topics
627711
• Total Posts
2978761
• Similar Content

• I want to make professional java 3d game with server program and database,packet handling for multiplayer and client-server communicating,maps rendering,models,and stuffs Which aspect of java can I learn and where can I learn java Lwjgl OpenGL rendering Like minecraft and world of tanks

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.