Jump to content
  • Advertisement
Sign in to follow this  
Lauvak

A glsl refraction demo

This topic is 4896 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This demo simulate refraction using GLSL shaders and pBuffers.
There is no cubemap involved.
The refraction effect is dynamic meaning that all the object in
the scene can refract the image from other objects.
The idea is to sort the objects according to eye distance and then
render them from back to front in a pbuffer texture.
The refraction effect:
for each fragment the refraction vector is calculated and added to
the 3d position of the fragment. This position is projected (gluproject equivalent)
to get the 2D coordinate of the refracted ray in the drawing buffer texture.
To avoid rasterization artifacts the front and back pbuffers are
used. Drawing is done in the front while using the back as texture input and then
the result is copied over. After all the objects are drawn the front buffer is copied on the
screen.
For objects with volume (like spheres) the front faces are culled in a
first pass and the back faces in the second pass.

Let me know what you think of it and how to improve it :-)

       

To compile you'll need DevIL, sg and glew libs

Executable and sources

 

 

[Edited by - Lauvak on May 25, 2005 8:56:49 AM]

Share this post


Link to post
Share on other sites
Advertisement
DLL hell...
glew32.dll - please link glew staticly.
msvcp60d.dll - What's this... I downloaded it from dll-files.com
When it finaly started.. I got "Could not find an acceptable pixel format".

Share this post


Link to post
Share on other sites
Sorry for the problems. That's my first post on the net and I'm not sure of what is needed to build something independent of my config.
About the acceptable pixel format my graphic card is a geforce fx 5700 with driver version 66.93. I haven't tested it on anything else.
Lauvak

Share this post


Link to post
Share on other sites
msvcp60d.dll is the C run time library in a dll file. You should have it if your a C/C++ developer

Share this post


Link to post
Share on other sites
I have included all the dll and lib that I think are needed to run the program.
Hope it works now.
Lauvak

Share this post


Link to post
Share on other sites
Yes free yahoo web site hosting is limited to about 5Mb download per hour... Since the demo is 2.5Mb that makes about 2 download per hour. If anyone knows of a better free hosting I would be interested.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!