POV-Ray : Newsgroups : povray.off-topic : Friday afternoon project: a real time ray tracer in your browser Server Time
6 Oct 2024 11:12:40 EDT (-0400)
  Friday afternoon project: a real time ray tracer in your browser (Message 4 to 13 of 33)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 13:57:48
Message: <55b27c9c$1@news.povray.org>
>> Ah well. I just get a JavaScript alert telling me that it can't
>> initialise shader1, then a couple that say "null", and then a message
>> that it can't initialise shader2.
>>
>> Ironically, I have a nearly identical setup: Opera (so, the Chrome
>> rendering engine), Windows 7, and an nVidia 600-series GPU.

>> Ah yes - it's not like you can just run the Mersenne Twister on a
>> GPU... ;-)
>
> Same here. But that was on Chrome. My graphics card is only an Ati 5770

Hmmm odd, I wonder why that is. I just tested it on my work PC (nVidia 
Quadro something) and it worked ok.

Maybe it's something to do with the length of the shader? You could try 
reducing the number of samples down to 1 (line 39) and the trace depth 
down to 2 or something (line 118), that should make the shader much shorter.


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 14:26:59
Message: <55b28373$1@news.povray.org>
On 24/07/2015 04:05 PM, scott wrote:
> An unbiased* global illumination ray tracer running in your web browser,
> with a max_trace_depth of 8 and support for shiny, diffuse, transparent
> and checkered spheres. What more do you want!

In other news, I just found this:

http://madebyevan.com/webgl-water/

Now I'm wondering why this thing that runs in a web browser and barely 
taxes the system looks 500x better than the water in any computer game, 
ever...


Post a reply to this message

From: Nekar Xenos
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 14:54:00
Message: <op.x2aj3x06ufxv4h@xena>
On Fri, 24 Jul 2015 20:27:08 +0200, Orchid Win7 v1 <voi### [at] devnull> wrote:

> On 24/07/2015 04:05 PM, scott wrote:
>> An unbiased* global illumination ray tracer running in your web browser,
>> with a max_trace_depth of 8 and support for shiny, diffuse, transparent
>> and checkered spheres. What more do you want!
>
> In other news, I just found this:
>
> http://madebyevan.com/webgl-water/
>
> Now I'm wondering why this thing that runs in a web browser and barely  
> taxes the system looks 500x better than the water in any computer game,  
> ever...
>

Good question. Looks awesome.

-- 
-Nekar Xenos-


Post a reply to this message

From: Samuel Benge
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 15:10:00
Message: <web.55b28cf0dee5de4ab426f96a0@news.povray.org>
scott <sco### [at] scottcom> wrote:
> An unbiased* global illumination ray tracer running in your web browser,
> with a max_trace_depth of 8 and support for shiny, diffuse, transparent
> and checkered spheres.
>
Excellent!

> What more do you want!
>
Um... how about full support for POV-Ray's SDL? jk ;D

> Disclaimer: It works on my machine (Chrome, Win7, nVidia GTX970) but
> I've not tested it on any other machine.
>
It works on my laptop (hardware is two AMD A6-4400M APU 2.7 GHz processors w/
integrated Radeon HD 7520G GPUs [not particularly bragworthy]) using Firefox
(see attachment). IE couldn't initialize shader1, but it did display the samples
counter.

> After creating the standalone html5 page for blobs thread above, I
> realised it would allow me to do something shadertoy doesn't - that is,
> reuse results from a previous calculation in the next frame.
>
I'll have to look into reusing samples again. My sole attempt used a 32 bit RGBA
texture (unsigned 8 bpp), but it never converged into an acceptably noise-free
result. I figured if I used a higher bit depth I might get better results.


Post a reply to this message


Attachments:
Download 'ffss-cropped.png' (154 KB)

Preview of image 'ffss-cropped.png'
ffss-cropped.png


 

From: Nekar Xenos
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 15:12:16
Message: <op.x2akycjhufxv4h@xena>
On Fri, 24 Jul 2015 19:57:47 +0200, scott <sco### [at] scottcom> wrote:

>>> Ah well. I just get a JavaScript alert telling me that it can't
>>> initialise shader1, then a couple that say "null", and then a message
>>> that it can't initialise shader2.
>>>
>>> Ironically, I have a nearly identical setup: Opera (so, the Chrome
>>> rendering engine), Windows 7, and an nVidia 600-series GPU.
>
>>> Ah yes - it's not like you can just run the Mersenne Twister on a
>>> GPU... ;-)
>>
>> Same here. But that was on Chrome. My graphics card is only an Ati 5770
>
> Hmmm odd, I wonder why that is. I just tested it on my work PC (nVidia  
> Quadro something) and it worked ok.
>
> Maybe it's something to do with the length of the shader? You could try  
> reducing the number of samples down to 1 (line 39) and the trace depth  
> down to 2 or something (line 118), that should make the shader much  
> shorter.
>

Great stuff!!
It works with samples 1, trace depth 6. If I try samples 2, I can only go  
up to trace depth 3.


-- 
-Nekar Xenos-


Post a reply to this message

From: Nekar Xenos
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 24 Jul 2015 15:44:35
Message: <op.x2amf8kvufxv4h@xena>
On Fri, 24 Jul 2015 20:27:08 +0200, Orchid Win7 v1 <voi### [at] devnull> wrote:

> On 24/07/2015 04:05 PM, scott wrote:
>> An unbiased* global illumination ray tracer running in your web browser,
>> with a max_trace_depth of 8 and support for shiny, diffuse, transparent
>> and checkered spheres. What more do you want!
>
> In other news, I just found this:
>
> http://madebyevan.com/webgl-water/
>
> Now I'm wondering why this thing that runs in a web browser and barely  
> taxes the system looks 500x better than the water in any computer game,  
> ever...
>

Wow! It even runs on my cell-phone!

-- 
-Nekar Xenos-


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 26 Jul 2015 08:47:33
Message: <55b4d6e5@news.povray.org>
On 24/07/2015 06:57 PM, scott wrote:
> Hmmm odd, I wonder why that is. I just tested it on my work PC (nVidia
> Quadro something) and it worked ok.
>
> Maybe it's something to do with the length of the shader? You could try
> reducing the number of samples down to 1 (line 39) and the trace depth
> down to 2 or something (line 118), that should make the shader much
> shorter.

I too was able to get this working by turning down the number of samples 
and the trace depth.

I also doubled the size of the image, so I can see what I'm looking at. 
(It seems to not like any size that isn't a power of 2. Then again, I 
have no idea how this stuff works, so...)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 26 Jul 2015 09:19:59
Message: <55b4de7f@news.povray.org>
On 26/07/2015 01:47 PM, Orchid Win7 v1 wrote:
> On 24/07/2015 06:57 PM, scott wrote:
>> Hmmm odd, I wonder why that is. I just tested it on my work PC (nVidia
>> Quadro something) and it worked ok.
>>
>> Maybe it's something to do with the length of the shader? You could try
>> reducing the number of samples down to 1 (line 39) and the trace depth
>> down to 2 or something (line 118), that should make the shader much
>> shorter.
>
> I too was able to get this working by turning down the number of samples
> and the trace depth.

I presume it looks weird due to the limited trace depth. (?)


Post a reply to this message


Attachments:
Download 'webgl.jpg' (108 KB)

Preview of image 'webgl.jpg'
webgl.jpg


 

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 26 Jul 2015 10:11:47
Message: <55b4eaa3$1@news.povray.org>
On 24/07/2015 06:00 PM, Orchid Win7 v1 wrote:
> On 24/07/2015 04:05 PM, scott wrote:
>> * One of the hardest bits is to get a random number generator running on
>> the GPU that is random enough to not show any patterns after a while.
>> There is still some subtle non-randomness visible, but it's way better
>> than it was originally. That's why there's random bits of code like
>> rng.x = sin(r1 - FrameNumber) in there. It seems to do the job.
>
> Ah yes - it's not like you can just run the Mersenne Twister on a GPU...
> ;-)

...actually, apparently you *can* run MT on a GPU. o_O

Trouble is, it's laughably slow.

Have you seen this? The accepted answer looks simplish...

http://math.stackexchange.com/questions/337782/pseudo-random-number-generation-on-the-gpu


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 26 Jul 2015 14:16:23
Message: <55b523f7$1@news.povray.org>
On 26/07/2015 14:19, Orchid Win7 v1 wrote:
> On 26/07/2015 01:47 PM, Orchid Win7 v1 wrote:
>> On 24/07/2015 06:57 PM, scott wrote:
>>> Hmmm odd, I wonder why that is. I just tested it on my work PC (nVidia
>>> Quadro something) and it worked ok.
>>>
>>> Maybe it's something to do with the length of the shader? You could try
>>> reducing the number of samples down to 1 (line 39) and the trace depth
>>> down to 2 or something (line 118), that should make the shader much
>>> shorter.
>>
>> I too was able to get this working by turning down the number of samples
>> and the trace depth.
>
> I presume it looks weird due to the limited trace depth. (?)

Yes it's probably highlighting the limitations in the RNG by only have a 
low trace depth. I uploaded a video of what it looks like here (samples 
40, trace depth 8) - woohoo for compressing noisy video!

https://youtu.be/rXQa5kHspFk

It only works with powers of two because your graphics card only allows 
power of two sized textures, and I'm not doing anything clever to check 
for powered-of-two-ness of the canvas size and creating bigger textures...

Also it's strange after staring at grainy images for a while your 
eye/brain just filters it out and you don't notice it. It's only when 
you then switch to a smooth image you go "wow that's really smooth" :-)


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.