Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Feb 2003
Offline Last Active Yesterday, 11:28 AM

Posts I've Made

In Topic: Variance Shadow Mapping With Expensive Terrain

31 October 2015 - 12:49 AM

Sorry for the slow response, just got back from my honeymoon!


Before doing anything else just draw the terrain to shadow map and see if the artifacts is even related to that. If that fix it then you either need to prebake terrain to some cheaper form or pick some another shadow map algorithm. Personally I have never been satisfied for VSM in real scenes.


I switched to ESM and I was able to reduce some artifacts. Even still, the terrain artifact is still there to a lesser degree. Prebaking the terrain is probably a solution, although it introduces a lot of complexity to solve a relatively minor artifact.


You shouldn't need to draw your terrain into the shadowmap as long as you clear the shadow map to the "maximum depth value".


Already cleared to max depth. The artifact I'm referring to is caused by blurring between max depth and occluders with much lower depth value. A blur with a very large depth difference produces shadows with sharp edges and reduces the ability of the blur kernel to eliminate discretization artifacts. This produces an artifact where shadows that project onto the far plane are sharp and discrete, but the blur antialiasing works well when the shadow is projected onto a non-terrain surface and the shadow edges there are soft.


Instead of using a shadowmap for shadows, you could bake the visibility between the terrain and the main light in an occlusion map. For each texel, cast a ray between the corresponding terrain sample towards the light, and store 0 or 1 depending on whether the ray hits the terrain or not. The intersection code can be optimized in several ways, for instance by precaching the terrain geometry instead of evaluating the fractal function on the fly.

An occlusion map has many advantages: it filters correctly, takes little memory (an 8 bit format is enough), gives you soft shadows for free and it's view independent. Of course you can tweak its resolution depending on your memory and runtime budget.

That's the approach I used more than 10 years ago for shadowing my terrains (on the CPU) and it worked very well. You should be able to prototype it on the GPU rather quickly.

Just an idea!


Not sure I follow what you're describing, if you could cite a whitepaper perhaps?


Another possibility I was looking at was ESSM, looks like it selects the blur kernel sizes variably, perhaps a solution might lie in a soft-shadowing algorithm like that.

In Topic: Variance Shadow Mapping With Expensive Terrain

16 October 2015 - 05:32 AM

Do you have the terrain represented in any other fashion? EG can you get it into a heightmap?


Not at the moment, although i've considered precalculating areas where the player gets close for other reasons.

In Topic: Starfighter Alpha Video Preview

17 December 2013 - 06:53 AM

Mouse, though probably would make for a better video using joystick or controller. Can run on tablet PC as well, though the framerate leaves something to be desired (about 20 FPS).

In Topic: has anyone here released a game that got no attention and make you depressed...

13 November 2013 - 08:47 PM

I've been doing game development as a hobbyist for decades and have never published a game, though I've loads of partially complete projects on old drives which have only been seen only in private circles. I suppose I helped with one released project, which sort-of counts.


But I'm not sad at all about it. A few years ago I produced a software tool with the intention of making money. Got a few clients and the project turned into hard work and quickly ceased to be fun at all. I eventually stopped supporting it to win my freedom back.


As a hobbyist I can afford to spend 6 months coming up with a unique procedural planet algorithm, but if I'm producing a product to sell to the masses it's all about producing content quickly and keeping costs down. I create my games as a hobby so it can be less like work and more like art.

In Topic: What is your poly budget?

09 July 2013 - 08:15 PM


750,000 on my most detailed model, with lots of culling. Mid size ships are between 30,000 and 70,000, can have several dozen of these on screen during large battles


On low-end hardware (HD4000) my GPU-accelerated fractal algorithm for planets is set to draw just a little over a million triangles, whereas on high-end PCs it can be cranked to push over 4 million triangles.


Various other effects (particles effects, stars/parallax) render several thousand more tris.


For mobile devices (e.g. HD4000) in total I push somewhere between one or two million triangles (unfortunately this comes at the cost of pushing 1080p framerates under 20 fps, though 720p is still very smooth). On more powerful desktops with good graphics cards I can push 5+ million on 1080p with no framerate drops. I haven't yet tested this on any ultra-powerful desktop machines, my hardware is a little dated. I suspect some new machines could do millions more tris.


My game is highly GPU-bound in terms of performance, CPU makes little or no difference except for load times (NOTE: load times can be pretty awful for complex models on low-end machines).