|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Fast Computation of Terrain Shadow Maps |
|
![]() CGameProgrammer Member since: 7/30/1999 From: San Diego, CA, United States |
||||
|
|
||||
| Doesn't it make more sense to use gouraud shading instead of lightmaps? I wrote a heightmap engine using gouraud shading. Due to the nature of heightmaps and the way the vertices are laid out, they're the ideal candidate for gouraud shading. I've abandoned my engine to do a new, better one, but I have a working demo. A sun and moon orbit the landscape, they are not drawn but the lighting is calculated for them. It at least illustrates what I mean. http://www.geocities.com/cgamedude/Vista.zip The engine uses OpenGL and Windows. Controls are WASD for movement and mouse for looking around. Escape quits. Run Vista.exe -mode fullscreen for fullscreen mode (it's windowed by default). ~CGameProgrammer( ); |
||||
|
||||
![]() Qatal Member since: 12/25/2001 From: New Zealand |
||||
|
|
||||
| um, i understand that there's a lot of ogl people here, but d3drm can do shadowing of terrain (and any object for that matter) automatically. its like: pD3DRM->createShadow(lpObj,lpLightDirectional,pShadowing); or something like that im a delphi coder myself so the c++ thing is well, um... |
||||
|
||||
![]() Dwiel Member since: 3/13/2001 From: Bloomington, IN, United States |
||||
|
|
||||
| I read through the article, but I'm not understanding how the author achieves semi-shadowd areas... Wouldn't the shadow be either there or not on any given vertex? How does he compute the fullness of a shadow? Thanx Dwiel [edited by - You on Febtober 93, -4793 BC 56:69:80 MP] |
||||
|
||||
![]() RAZORUNREAL Member since: 1/18/2004 From: Auckland, New Zealand |
||||
|
|
||||
| The shading is not because of the shadow. Where it is shadowed, the lighting isn't calculated at all (well ambient lighting is. But ambient lighting always is.). The shading is because of the lighting equation. With diffuse lighting, the closer the normal direction is to the oposite of the light direction (the closer the vertex/polygon is to facing the light) the more it is lit up. If this were not the case people would be reinventing the law of conservation of energy all the time, but dont worry about that. I think I have come up with a way of doing this exact thing much faster, but I'll have to try it to know for sure. Let you all know if I have. First I should check if I'm understanding this correctly. Does his method involve checking the heights of all the vertices in a line towards the sun for every vertex it lights? Qatal, I'm interested in that call, bacause there are several ways of shadowing. I dont know anything about d3d btw, so I cant really tell what the function would do. But I dont see how it could be to do with volumetric stencil shadows or shadow maps, so it's most likely to be the good old technigue where for every triangle of the recieving object you squish the shadowing oject flat onto the plane the triangle rests in, colour it black (and possibly with alpha) and draw any of the resulting object that lies inside the triangle (using the stencil buffer normally, but maybe d3d itself wouldnt have to). Theres two bad things about that though. 1.It's very very slow if the thing recieving the shadow has alot of polys. 2.No self shadowing (unless you treat every tri as a seperate object, in which case it's very very VERY slow). [edited by - RAZORUNREAL on January 18, 2004 7:17:19 AM] [edited by - RAZORUNREAL on January 19, 2004 6:33:34 AM] |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|