Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Mar 19, 2024 3:21 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: shadow experiments
PostPosted: Tue Nov 16, 2010 9:33 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I recently discovered Tricky Truck, thanks to RyLe, and I was stunned by the look of the shadows in this game.

It seems that it renders shadows from multiples positions around the light and blends it, creating a nice, smooth, "ambient occlusion" styled result.

It tried very quickly to write a small patch (currently < 50 lines) to see if it's possible to have this type of rendering, and here's the result of the first experimentation: http://ftp.cqfd-corp.org/too-slow-to-stay-shadows.jpg (sorry, too lazy to create a thumbnail for the picture).

This is (way) not quite as good (at all) as the original, but I like the way it looks :) This is just a try, since the current way to do this requires a lot of pass to render the ground and it completely kills the framerate. This is only brute-forcing :)

I'll try to push experimentations a bit further.


Top
 Profile  
 
 Post subject: Re: shadow experiments
PostPosted: Tue Feb 15, 2011 7:44 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Is it possible to highres shadowmap size to have sharpen shadow ?

I can tweak shadow.c line 101, but if i change size coef from 1/2 by more than 1, no more shadow :(

Is it easy to change this ?

Have a nice day.
Ouille


Top
 Profile  
 
 Post subject: Re: shadow experiments
PostPosted: Thu Feb 17, 2011 10:00 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
To improve shadowmap quality, with our newest RAYDIUM_SHADOW_MODE_CAMERABOX mode, you can work on two parameters:
- shadow map texture size
- mapping area size

The shadow texture size is based on rendering window size, because of the way shadows are currently generated (Perhaps could we think about a "render-to-texture" shadow mode (if hardware supports it) that would allow way bigger maps). So one easy way to improve shadows is to run the application fullscreen. About the line 101 in shadow.c, I must admit that I can't remember why it's here :/ Probably some performance issue during shadow system development ? I'll make a few tests and probably remove this "reducing factor" so the shadow map size will match (closest power of two) window size, shadows will be 2 times more accurate. Can you confirm it works for you with "raydium_shadow_map_size=tmp" ?

For the second parameter, raydium_shadow_camerabox_size() will help you to define how far from the camera the shadow will be rendered. Less means that shadows will be more accurate and looks less blurry and pixelated, but shadow clipping will be closer to the camera (here, again, it would be a good idea to think about a smooth clipping to improve how shadows looks)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group