Logo by Pauldelbrot - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 26, 2024, 12:03:45 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: 3D fractals using shader 2  (Read 8663 times)
0 Members and 1 Guest are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« on: October 13, 2010, 01:00:12 PM »

Hi all, am fairly new to programming GPU. Am using OpenGL ES2 and so far have just released "Free iCandy" for the iPhone which does realtime Julia Set animations (32 formulas, 150 colourings) including animation to external sound/music:

http://itunes.apple.com/us/app/free-icandy/id381061184?mt=8

At the moment only available in the US.

I want to go on to do more fractal stuff for shader 2, including 3D fractals but am inexperienced with OpenGL so have some questions that I think will take a while to answer by myself.
Obviously using shader 2 to render 3D fractals has the same issue as rendering using Ultra Fractal in that there is no shared information from one pixel to another so I have the following questions:

1. Can a shader 2 program render such that it not only sets colours in the render buffer but also sets correct values in a z-buffer at the same time ?
and assuming this is possible:
2. Could a second shader 2 program then use the colour buffer and z buffer produced by the first program to add lighting to the values from the colour buffer (as a source texture) and render to a destination buffer ?

Or am I completely on the wrong track here ?
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: October 13, 2010, 02:44:42 PM »

hi dave, nice you are stepping into gpu programming

in the latest shader versions you can define multiple render targets, as far as i know it is not possible with 2.0 shaders, but i am not sure,

one solution might be to use a 4 component float bitmap format as output, and use the alpha value as z-value,

after that it is easy to combine multiple textures ( for any purpose ) into a new shader, this is common practice, and
hence it never leaves the gpu memory very efficent...
Logged

---

divide and conquer - iterate and rule - chaos is No random!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #2 on: October 14, 2010, 04:08:21 AM »

Oh, I thought z-buffering was included and all that was required was to enable it (I mean that there was a mechanism that would allow z-buffer output as well as the actual render buffer), I guess I need to do more reading up on OpenGL smiley
But using 4-valued float output is a workable alternative smiley
« Last Edit: October 14, 2010, 04:14:27 AM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #3 on: October 14, 2010, 12:43:57 PM »

Trifox: I don't think OpenGL ES will support fp render targets?

Great stuff Dave smiley (You'll want to help that disgruntled user on the app store page soon however!)

Regarding how to do the rendering, you basically make two passes: in the first pass, a fullscreen shader outputs depth data into a write-only texture (1:1). In a subsequent pass, this texture is bound to a full-screen quad (or single triangle if you're crafty) as read-only input and used to produce the final output image.

The issue of depth representation is a trick one in the absence of floating point output. I don't know if you can have a shader output plain z, so you might use some 4-byte depth representation (perhaps fixed point?) at the cost of some overhead.
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #4 on: October 14, 2010, 06:10:59 PM »

Thanks Lyc - without checking I seem to remember that ES2 does allow fp output or at least I'm sure it's possible to cofigure the output buffer as an fp colour buffer - just not sure whether that means it woud actually work with the current hardware or not without trying it smiley
As to the disgruntled customer, we sent an explanation/apology but unfortunately can't respond with a comment in the App store as Apple do not allow developers to reply to comments on their apps (!!). There's not much to complain about though since the App is coimpletely free. Steve has now modified the text on the page to try and make sure that the requirement for the newer (3GS or later) OpenGL ES2 devices is clearer to the readers/customers.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
DirectX 11 compute shader / Directx 10 Pixel shader implementation Mandelbulb Implementation cbuchner1 2 16953 Last post November 29, 2009, 12:32:26 AM
by cbuchner1
fp64 shader Programming marius 8 6399 Last post February 11, 2012, 06:49:23 PM
by Saquedon
Mixing Fractal IFS types shader Programming tryptophan 8 8871 Last post April 15, 2013, 09:38:50 PM
by tryptophan
realtime rendering with gl shader Movies Showcase (Rate My Movie) sleeplessmonk 2 2048 Last post October 12, 2014, 09:04:47 PM
by SeryZone
fractalforums shader project Let's collaborate on something! cKleinhuis 8 5488 Last post June 02, 2015, 09:37:51 PM
by cKleinhuis

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.185 seconds with 24 queries. (Pretty URLs adds 0.013s, 2q)