Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 19:12

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 21.07.2010, 13:51 
Offline

Joined: 21.10.2009, 16:25
Posts: 7
Hi,

I'm currently trying to create a visually pleasing environment for the techdemos in our research group, using Horde3D.

To that end, I've tried to implement a shading technique that will illuminate the scene in a non-photorealistic, global manner - without actually placing lights in the scene. At the moment I'm combining SSAO and flat texture shading, and I'm halfway pleased with the outcome. (I've attached a sample output below.)

Image

However, you can see that there are some problems with my approach. Most obvious is the strong blurring of some of the geometry when I multiply the flat shaded buffer with the ambient occlusion buffer. Seeing the application in motion, there are also some shading artifacts whenever the view changes. I'm not sure how to fix any of that.

For the SSAO shader, I more-or-less copied the one from here. I'm making my source code (binary included) available here: http://www.compsens.uni-tuebingen.de/pub/pages/personals/10/SSAO_test.zip

If any of you have suggestions how to improve my rendering, I'd be grateful.

Karsten


Top
 Profile  
Reply with quote  
PostPosted: 21.07.2010, 18:39 
Offline

Joined: 08.06.2010, 14:17
Posts: 63
First thing you should do is to eliminate low frequency noise. Assuming you use screen coordinates as a seed for PRNG you can simply do something like
vec2 coord=mod(gl_FragCoord.xy,4.0);

High frequency noise can then be eliminated with selective blur (based on depth, or even better depth and normal).

EDIT: Looking at your code...
Using texture instead of prng, very interesting approach. I wonder if it's more efficient.

Anyway, try replacing

vec3 fres = normalize((texture2D(randomSamples,texCoords*offset).xyz*2.0) - vec3(1.0));
with
vec2 rngCoords=mod(gl_FragCoord.xy,8.0)/8.0;
vec3 fres = normalize((texture2D(randomSamples,rngCoords*offset).xyz*2.0) - vec3(1.0));

that will remove low frequency noise, selective filter should be easy.

EDIT2: If AO is your only form of shading, I'd recommend trying this method. It's slower but much less direction dependent.


Top
 Profile  
Reply with quote  
PostPosted: 22.07.2010, 22:41 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
There are so many different SSAO implementations these days that it's tough to pick the best one ;)
A well documented one which looks quite promising at a first glance is here. It is relatively simple and should be easy to integrate into our deferred pipeline.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 19 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