POV-Ray : Newsgroups : povray.off-topic : GPU rendering : Re: GPU rendering Server Time
7 Sep 2024 05:11:33 EDT (-0400)
  Re: GPU rendering  
From: scott
Date: 18 Jul 2008 03:08:35
Message: <48804173$1@news.povray.org>
> OK, so for anybody who knows about such things... Would it be feasible to 
> render an Iterated Function System image using a GPU? And would it be any 
> faster than using the CPU?

Yes, and yes it would be much faster.  Sometimes you need to think a bit 
before implementing such a thing though...

I would run several points through the IFS in parallel.  Say, 2^16 points. 
Create two 256x256 textures of floats, one to hold the X coordinates and one 
to hold the Y coordinates of all your points.

Then write two pixel shaders, one to calculate the new X coordinate, and one 
to create the new Y coordinate.

Then, for each pass, set the current X and Y textures and inputs, and render 
to the newX texture.  Render again to the newY texture with the other pixel 
shader.

Now, here comes the clever bit.  After you've generated the new XY textures, 
you now run a *vertex* shader with 2^16 quads.  THe vertex shader looks up 
the XY values from the texture for each quad and translates the quad to that 
position.  You can then just use a fairly normal pixel shader to increment 
the pixel value on the screen, or some off-screen texture.

It should run pretty fast, and don't forget you're doing 64k points in 
parallel so it should outrun the CPU by a huge factor.


Post a reply to this message

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