Page 1 of 1

AGT3 discussion 2014

Posted: Sat Sep 20, 2014 11:45 pm
by 122675
Hey guys!
Last year there were some threads on graphics programming courses by Jacco where we could share our progress and help each other out. This year, the forums have been very inactive, but I'm hoping that will change soon. Seeing what other people are doing is very motivating and inspiring, so if you implemented some cool new graphics technique that you learned about through SIGGRAPH or Shadertoy or whatever, please do share!

Motion blur
Motion blur makes movement look a lot smoother. It's almost as if you have a higher frame rate. I implemented it as a post-process effect that only takes the camera movement into account, so fast moving objects will not be blurred if the camera stays still. You can see the effect motion blur has on a single frame in my screenshot below, where a camera is moving forward at a high speed.
- Resources: [1], [2]
Image

Volumetric lighting
Volumetric lighting (aka God rays or crepuscular rays) are rays of light that bounce off of particles in the air, creating visible beams of light. I found a simple algorithm to create this effect in GPU Gems 3, chapter 13. The naive implementation uses only the color buffer, but the book recommends using a buffer where all occluding objects are rendered in black for a better result. When I tried this, however, I found it to be slower (because I first linearize the depth buffer to create the occlusion buffer) and for some reason it also didn't look as good as the naive implementation. In my screenshot you can see the sun through the railings on the boat, creating light volumes and shadow volumes.
- Resources: [1]
Image

Clouds
I was inspired by this shader by David Hoskins (who has many great shaders on Shadertoy and YouTube) to create procedural clouds. I used a 3D noise function to generate the volumetric data that describes the clouds. To render this volumetric data, I used a technique called ray marching. For each pixel you send a ray in the view direction through the cloud layer and you check a set amount of points along that ray. Each point will qualify as either air or cloud (0 or 1), based on the volumetric data. The average value of these points tells you how thick the cloud should look at that pixel. Then you send a ray towards the sun and again check a number of points along that ray. This will give you the amount of light that reached the cloud at that point. Below are some screenshots of my clouds at different times of day. The noise function I'm using is fast enough to simulate the clouds in real time, but it creates some artifacts so I'm still looking for a better one.
- Resources: [1], [2]
Image
Image
Image

So, that's what I've been up to lately. The next things I want to try are SSAO and screen space reflections. If you have any interesting resources or videos about graphics or you want to share some of your progress, please post it here.
Peace!

Re: AGT3 discussion 2014

Posted: Sun Sep 21, 2014 9:39 am
by 110177
Ooh, I like it, a lot! Especially the clouds are a really nice touch! :o

The resource you've used for god rays is a rather old one though, and suffers from the problem that - if either the light source or the occluder are not in view - the god rays don't appear. In case you want to see implementations that work around that issue:

- http://www.alexandre-pestana.com/volumetric-lights/
- https://software.intel.com/sites/defaul ... -final.pdf (large outdoor environment extension: https://www.youtube.com/watch?v=6ziCrFW1Mu0 )

(Still need to actually read that last one, thank you for reminding me :P )

Apart from that, I don't really have much to add. I am not doing the AGT3 course. (did that last year, but not a whole lot extra aside from the main requirements - sadly) Would love to see everyone's progress though. :)

Re: AGT3 discussion 2014

Posted: Sun Sep 21, 2014 12:00 pm
by 110157
Cool stuff!

As for SSAO, I did my specialization on it last year and wrote a guide outlining several techniques.

If you want to take a look;

Guide: https://dl.dropboxusercontent.com/u/179 ... 20SSAO.pdf
CD (180mb - source and binary): https://mega.co.nz/#!oQ4RSbpD!07BLLSQ7D ... z0lZK7_X3M

Also, here's my take on clouds last year;

Image

Simple billboard particles with some normal trickery to make them appear volumetric-ish.

Re: AGT3 discussion 2014

Posted: Tue Sep 23, 2014 8:01 pm
by 122675
@Rick Thanks for the links! The technique that uses shadow maps seems very straight forward and looks great, so the next time I implement volumetric lighting I will definitely do it that way.

@Sam Very nice guide and demo! I decided to implement Crytek's SSAO algorithm because it's the easiest one and has the best performance (according to your timings :P). I followed some recommendations from your guide, like using the normals to avoid self-intersection and taking occlusion range into account. I also really liked your idea of using a simple repeating texture to get some randomness, because I was using a random function at first, which cost me a lot of performance. Finally, I used an edge-preserving box blur to get a smoother look to the effect.
This is the result (just the ambient term):

Image

Ambient occlusion shows the shapes of the geometry very clearly, which is useful in scenes where the textures and lighting don't:

Image

Here is the same scene multiplied by the ambient term:

Image

I could probably do some more optimizations because my SSAO is quite expensive at the moment. I'm even rendering the AO at half resolution in order to get a good frame rate in full screen.
Anyway, I have to put some time into my other courses now, but please keep the links (and specialization projects :P) coming, guys!

Re: AGT3 discussion 2014

Posted: Sat Oct 04, 2014 4:06 pm
by 120186
Hey guys,

I'm currently doing water reflections and I have a problem with clipping my reflections. I'm using the Nils engine but this is more of a "What's the technique to do this" question.

This is what I currently have:
Image

So, I'm rendering my scene to a seperate FBO, I guess this is also the part where you clip them before it becomes a simple texture. Do I have to create a seperate shader for all of my objects which includes clipping? It seems too cumbersome to get it done that way. Are there any alternatives?

Kind regards,
Jasper

Re: AGT3 discussion 2014

Posted: Sat Oct 04, 2014 4:28 pm
by 120186
Oh, oops. Never mind what I asked. I totally overlooked the clipplane already available in the engine. Appologies :lol:

Re: AGT3 discussion 2014

Posted: Fri Dec 12, 2014 2:02 am
by 130802
I guess I'll share my path tracer I made in GRP1:

Image