Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualIvanK

Posted 11 June 2012 - 06:57 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?

#3IvanK

Posted 11 June 2012 - 06:57 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, which will be nice looking, but keep my demo at 60 FPS?

#2IvanK

Posted 11 June 2012 - 06:41 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.

Do you have an idea for any other "cheap" effects, which will be nice looking, but keep my demo at 60 FPS?

#1IvanK

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 :) 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.

Do you have an idea for any other "cheap" effects, which will be nice looking, but keep my demo at 60 FPS?

PARTNERS