Transmittance Part II

Ok, I started making the Transmittance shader, and this is how far I got:
 

Here we can see a green glass ball absorbing the pixels behind it, and before the rays hit our eyes( camera ) the color is absorbed based on how long/far it travels trough the sphere.

This effect is mostly a post process effect, where I use two depth maps to find out how thick the object is. This is done by first rendering the sphere’s backfaces into one depth buffer, and then rendering the spheres frontbuffer into another buffer; taking the difference of these two textures will give me the thickness of the object.

If you take a look at the spikeball, it contains some artifacts. This is because of the way I find the depth of the object. There are many ways of getting these look better and I will get back to this later! 😉

Then, I use Beer-Lambert’s law to compute the amount of light absortion:
Transmittance =exp(-absotrion*concentration*distance), where the absortion = -log(Transmittance)/distance.

I will post more updates on this as I’m making progress, and give out the source code/executable.
The application is written using DirectX10 right now, but it will be a trivial task to convert it to XNA once it’s done.

Advertisements
This entry was posted in Technology. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s