Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Realtime raytraced browser game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 IvanK   Members   -  Reputation: 116

Like
1Likes
Like

Posted 11 June 2012 - 06:39 PM

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 Posted Image and also I want to ask few questions.

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

http://frog.ivank.net

Few interesting things about it:
  • 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".
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
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;
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, 11 June 2012 - 06:57 PM.


Sponsor:

#2 Promit   Moderators   -  Reputation: 7638

Like
0Likes
Like

Posted 11 June 2012 - 06:49 PM

Try using atan2 instead, as it's far more robust.

#3 Yours3!f   Members   -  Reputation: 1396

Like
0Likes
Like

Posted 12 June 2012 - 04:01 AM

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.

Attached Thumbnails

  • bug.png


#4 IvanK   Members   -  Reputation: 116

Like
0Likes
Like

Posted 12 June 2012 - 07:38 AM

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?

#5 Yours3!f   Members   -  Reputation: 1396

Like
0Likes
Like

Posted 12 June 2012 - 12:26 PM

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?


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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS