POV-Ray : Newsgroups : povray.off-topic : Friday afternoon project: a real time ray tracer in your browser Server Time
6 Oct 2024 06:09:09 EDT (-0400)
  Friday afternoon project: a real time ray tracer in your browser (Message 21 to 30 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 27 Jul 2015 13:35:24
Message: <55b66bdc$1@news.povray.org>
On 27/07/2015 11:47 AM, scott wrote:
> As highlighted on that page, the main problem is that every single pixel
> runs exactly the same code with the same inputs (apart from pixel
> coordinate). So you need some way of making every pixel generate a bunch
> of random numbers that are in no way related to any other pixels in the
> image (otherwise you get strange patterns like you saw with your 1
> sample image).

I wonder how long before GPU gets a hardware-based randomness source? 
(It can't be that hard to sample a little thermal noise in hardware, 
especially if you don't need cryptographic strength. The problem is 
usually that hardware randomness sources are a tad slow...)


Post a reply to this message

From: Johannes Rexx
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 28 Jul 2015 02:45:01
Message: <web.55b724a0dee5de4aea9e60760@news.povray.org>
This works out of the box on OS X Yosemite under Google Chrome and it does so
very well indeed. This is a very clever piece of work. Thanks for sharing it
with us.


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 28 Jul 2015 02:55:16
Message: <55b72754$1@news.povray.org>
> This works out of the box on OS X Yosemite under Google Chrome and it does so
> very well indeed. This is a very clever piece of work. Thanks for sharing it
> with us.

Thanks! I can only claim credit though for modifying an existing path 
tracing algorithm to run on a GPU and modifying JS/WebGL boiler-plate 
code from various sources. I'm quite happy that it all runs from a 
single html document though, hopefully it's a good platform for anyone 
to tinker about with.


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 29 Jul 2015 04:19:24
Message: <55b88c8c@news.povray.org>
So do you remember a few years(?) back when 3D Mandelbulbs were all the 
rage? IIRC there were some threads on these very groups about rendering 
them in POV, however it was painfully slow.

Well now you can do it in realtime on a (fast) GPU near you :-)

I need to tidy up the code a bit to make it easier to "fly around" and 
control the detail settings, but here's a quick teaser:

https://www.youtube.com/watch?v=r_Ek3Kfv8KA

Note there's nothing pre-calculated here, the GPU is doing all the work 
on the fly.


Post a reply to this message

From: clipka
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 31 Jul 2015 20:55:52
Message: <55bc1918$1@news.povray.org>
Am 27.07.2015 um 19:35 schrieb Orchid Win7 v1:

> I wonder how long before GPU gets a hardware-based randomness source?
> (It can't be that hard to sample a little thermal noise in hardware,

Well, GPUs should at least be able to provide plenty thermal for the 
noise ;)


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 4 Aug 2015 04:55:14
Message: <55c07df2$1@news.povray.org>
>> I wonder how long before GPU gets a hardware-based randomness source?
>> (It can't be that hard to sample a little thermal noise in hardware,
>
> Well, GPUs should at least be able to provide plenty thermal for the
> noise ;)

Yes :-)  It's not hard to sample the thermal noise, the problem is how 
to sample it billions of times per second with enough resolution to be 
useful.


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 4 Aug 2015 13:00:38
Message: <55c0efb6@news.povray.org>
On 04/08/2015 09:55 AM, scott wrote:
>>> I wonder how long before GPU gets a hardware-based randomness source?
>>> (It can't be that hard to sample a little thermal noise in hardware,
>>
>> Well, GPUs should at least be able to provide plenty thermal for the
>> noise ;)
>
> Yes :-) It's not hard to sample the thermal noise, the problem is how to
> sample it billions of times per second with enough resolution to be useful.

Well, no, you typically sample it a few times a second and use that to 
seed a normal PRNG.

In other news, Intel added an op-code to generate truly-random numbers 
using exactly this technique. The Linux kernel team added it to 
/dev/random... and then took it out again, because they were apparently 
concerned that the NSA would modify the die of your CPU to make the 
random numbers non-random. (!!)

Jesus, that's next-level. Surely if you don't trust the hardware your OS 
is running on, it's already game over. (?)


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 5 Aug 2015 04:24:23
Message: <55c1c837$1@news.povray.org>
>> Yes :-) It's not hard to sample the thermal noise, the problem is how to
>> sample it billions of times per second with enough resolution to be
>> useful.
>
> Well, no, you typically sample it a few times a second and use that to
> seed a normal PRNG.

But will that not cause the same problems seen already today with 
unrandomness? If the pixel shader for every pixel gets exactly the same 
random seed value, and just uses a PRNG to modify it, won't you see 
patterns? I would have thought every pixel needs its own unique random 
seed value every frame to really get rid of those sort of PRNG patterns. 
If you want a *truly* unbiased ray tracer for example.

> In other news, Intel added an op-code to generate truly-random numbers
> using exactly this technique. The Linux kernel team added it to
> /dev/random... and then took it out again, because they were apparently
> concerned that the NSA would modify the die of your CPU to make the
> random numbers non-random. (!!)

Apparently the on-chip thermal noise sampler outputs a stream of bits at 
3 GHz. I don't know how big the hardware is for that circuit, but it's 
not *that* far away from what you'd need to get a true random number for 
every pixel processed on the GPU.

> Jesus, that's next-level. Surely if you don't trust the hardware your OS
> is running on, it's already game over. (?)

Yes, something like a true RNG in every home home PC seems like 
something the NSA would be extremely interested in.


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 5 Aug 2015 16:28:40
Message: <55c271f8$1@news.povray.org>
On 05/08/2015 09:24 AM, scott wrote:
>>> Yes :-) It's not hard to sample the thermal noise, the problem is how to
>>> sample it billions of times per second with enough resolution to be
>>> useful.
>>
>> Well, no, you typically sample it a few times a second and use that to
>> seed a normal PRNG.
>
> But will that not cause the same problems seen already today with
> unrandomness? If the pixel shader for every pixel gets exactly the same
> random seed value, and just uses a PRNG to modify it, won't you see
> patterns?

My plan was more to have some hardware that seeds a PRNG with a 
truly-random seed and then distributes a *different* random iterate from 
the PRNG to each thread in the bunch. It's awkward to code in software, 
but shouldn't be that hard in hardware...

> Apparently the on-chip thermal noise sampler outputs a stream of bits at
> 3 GHz. I don't know how big the hardware is for that circuit, but it's
> not *that* far away from what you'd need to get a true random number for
> every pixel processed on the GPU.

OK.

>> Jesus, that's next-level. Surely if you don't trust the hardware your OS
>> is running on, it's already game over. (?)
>
> Yes, something like a true RNG in every home home PC seems like
> something the NSA would be extremely interested in.

It's slightly mental that the government of one country can insert spy 
hardware into every computer that can ever exist... Especially given 
that all silicon fabrication is done in countries hostile to America... 
But hey, what do I know?


Post a reply to this message

From: scott
Subject: Re: Friday afternoon project: a real time ray tracer in your browser
Date: 6 Aug 2015 03:20:12
Message: <55c30aac$1@news.povray.org>
> It's slightly mental that the government of one country can insert spy
> hardware into every computer that can ever exist... Especially given
> that all silicon fabrication is done in countries hostile to America...
> But hey, what do I know?

Oh don't worry, I'm sure if the NSA were capable of inserting spy 
hardware into CPU dies, the fab itself would be more than capable of 
changing it back to something more to their (or their government's) 
liking :-)


Post a reply to this message

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

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