Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: efecto on September 07, 2009
-
I'm trying to render a mandelbrot in a pixel shader.
I use one of iq's 4k frameworks and have converted his g4k_OGLShader example from GLSL to HLSL
However only a part of the mandelbrot is showing. (as seen in the attachment)
I don't think it is the hlsl code as that is pretty much the same as the glsl
so i think it is in the texture coordinates or the vertex setup, but that seems okay.
Anyone an idea where i should start looking?
cheers,
Efecto
-
If you want the full set, you need the coordinates -2,-2 to +2,+2. I would guess the incoming pixel fragments have screen x, screen y as the inputs, so you'd need to do
inputx = (x-(screenwidth/2)/(screenwidth/4)
inputy = (y-(screenheight/2)/(screenheight/4)
and plug those inputs into the mandelbrot equations.
Jim
-
Ah..
I was using texture coordinates, so only range 0-1.
worked around than now (as i don't have a vertex shader).
mandelbrot is working now.
Thanks Jim !