Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / How is REFRACTION coded in x10?

Author
Message
srealist
15
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 5th Mar 2011 19:56
Hi all,

Posting this here rather than the x10 forum as I figure some x9ers might know the answer - not to mention, there are about 4 people other than me that post regularly in the x10 forum.

Does anyone know how refraction is coded in x10? Is it based on ray tracing or some other algorithm? Is it a scientifically valid method?

I'm curious because I am building a series of educational games and one of the topics I want to cover is optics.

Thanks!

Here is the .fx file for those who can interpret such things:
Alamo
21
Years of Service
User Offline
Joined: 18th May 2005
Location:
Posted: 5th Mar 2011 22:45
I´m affraid you are on the wrong track here. So called "raytracing" or "refraction" used in the engine is just shader effect using texture trick to fool the eye. Even when it can look cool, it does not have much to do with scientific calculation of light. However, there are some solutions for this in GPU I believe... Check Nvidia demos here.

There are raytracers which are using GPU power while computing the result. True "optics" is too heavy on computer power to use it in any mainstream realtime application right now...

Good luck with your educational project! A.

srealist
15
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 5th Mar 2011 22:54
Thanks, Alamo. Mostly I'm just curious as to what principle is behind the refraction technique in FPSCx10. For instance, I want to let the users toggle some buttons to dynamically change the level of refraction on a glass entity, while discussing the scientific principles behind refraction or even discussing graphics techniques of simulating refraction. Even if the technique isn't accurate in a real world sense, I think it is a useful for students to learn about how optical illusions are used in CG to give us the perception of glass (for instance).
Doctor 3D
16
Years of Service
User Offline
Joined: 19th May 2010
Location:
Posted: 5th Mar 2011 23:50 Edited at: 5th Mar 2011 23:52
While I'm not adept to the complexity of how the GPU performs the instructions. When I look at the shader I think it's doing this:


-Obtain color information
-Looks at the Normal Map - Usually these are "Wavy" for glass textures.
-Generates a bump in the glass based on the height of the normal
-Looks at the specular - Usually light silver-grey emphasizing glass-Waves
-Generates an Alpha-smomkey type fog effect based on the last two textures
-Light- calculate impact on diffuse
-Light- calculate fog effect distance
-Light- calculate ambient impact on specular

I couldn't write one of those things to save my life. But, I love messing around with them. Even though, half the time, I don't even know what I'm doing, I just learn as I go.
srealist
15
Years of Service
User Offline
Joined: 18th Dec 2010
Location: Orlando, Florida, USA
Posted: 6th Mar 2011 11:06
Thank you. Your description translates very well for me. I appreciate the high level explanation. I used to just be a sound designer so a lot of this is completely new for me despite working in VR for the last 10 years.

Cheers,
srealist

Login to post a reply

Server time is: 2026-06-30 22:58:57
Your offset time is: 2026-06-30 22:58:57