Sign in to follow this  
IvanK

Realtime raytraced browser game

Recommended Posts

Hi guys,

I am sorry, I don't have any real problem, I just wanted to show you what I have done during the last weekend and didn't find any good category for it [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] and also I want to ask few questions.

I have written a simple GLSL raytracer, which is rendered in browser using WebGL.

[url="http://frog.ivank.net"]http://frog.ivank.net[/url]

Few interesting things about it:[list]
[*]in Windows browsers it is 2x slower than in Linux or Mac OS, because all Windows browsers translate GLSL to HLSL and render it with Direct3D.
[*]It started to be 2x slower when I started to use a texture for environment. I really didn't expected that texture access is so "expensive".
[/list]
I also have 2 questions:

When I map the image as environment and I want to get a texture coordinate from ray direction, I use "atan" function to get an angle
[CODE]float iPI = 1.0/3.14159265357;
float cx, cy;
cx = 0.5 - 0.5 * atan(dir.x, dir.z) *iPI;
cy = 0.5 - asin(dir.y)*iPI;[/CODE]
but there is a black vertical line appearing on the left side. Do you know how can I avoid that? It will be probably because of division by zero or something.

So what do you think about it? Do you have an idea for any other "cheap" effects or objects, which will be nice looking, but keep my demo at 60 FPS? Edited by IvanK

Share this post


Link to post
Share on other sites
nice! but I have a little bug on xUbuntu 12.04 with catalyst 12.4 64bit. Cubemaps doesn't seem to work, or at least the texture isn't there in the background ( you can see it on the spheres though). This might be a catalyst but, because I've seen this in games and other OGL apps as well.

Share this post


Link to post
Share on other sites
Thank you.

Promit: two-parameter "atan(y,x)" in GLSL is equivalent to "atan2(y,x)" in HLSL. There still is a black vertical line on left.

Yours3!f : that is weird, I have no idea why it happens. Have you tried using Chromium?

Share this post


Link to post
Share on other sites
[quote name='IvanK' timestamp='1339508322' post='4948480']
Thank you.

Promit: two-parameter "atan(y,x)" in GLSL is equivalent to "atan2(y,x)" in HLSL. There still is a black vertical line on left.

Yours3!f : that is weird, I have no idea why it happens. Have you tried using Chromium?
[/quote]

yep, but like I said if it works on windows (on amd/ati) then its a catalyst bug.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this