Incredible long shader compilation time (HLSL)
category: general [glöplog]
Argh. Now my shader gets all kind of weird artifacts when I remove the "D3DXSHADER_SKIPOPTIMIZATION" flag!
looks like the optimization fucks it up.. you gonna have to optimize by hand :D ..or figure out what gets fucked up and shuffle it a bit
I have given up again.. I have added a perlin noise routine call in the distance function. Now even with the flag it takes ages (10+ minutes) again. Had to kill the process.
I will give it a try soon with OpenGL.
I will give it a try soon with OpenGL.
It's also not just my code. iq posted a realtime implementation of slicesix some weeks ago on pouet but I had to kill the process as well because of never ending shader compilation.
Have you tried JavaScript?
*rgba_slisesix
Kusma, I will give it a shot ;)
regular noise() of HLSL is way too slow for realtime anyway !!
also: this code is stranger than thought already:
after i put a [do...while] in there it started to compile ages for me ! wtf ?!
trying in rendermonkey but dowhile never bugged so far, just sped up the shader !
for noise: pseudo_random_number_generator should help ! iq did one, also to be found in valleyball_source !
also: this code is stranger than thought already:
after i put a [do...while] in there it started to compile ages for me ! wtf ?!
trying in rendermonkey but dowhile never bugged so far, just sped up the shader !
for noise: pseudo_random_number_generator should help ! iq did one, also to be found in valleyball_source !
I am not using noise() but my own implementation!
I will give rendermonkey a shot. Thanks again.
I will give rendermonkey a shot. Thanks again.
i have a problem aswell: instancing !
i tried in my own marcher already aswell with CPs sth like:
sphere( float3( fmod(p.x,5), p.yz );
i think its obvious what i´m trying to do, but i´m getting weird stuff onscreen !
guess its just a wrong way of implementation, so what am i completely missing again ?
i tried in my own marcher already aswell with CPs sth like:
sphere( float3( fmod(p.x,5), p.yz );
i think its obvious what i´m trying to do, but i´m getting weird stuff onscreen !
guess its just a wrong way of implementation, so what am i completely missing again ?
this works for me:
position.x = fmodf(position.x + 100.0f, 0.4f) - 0.20f;
(from a software implementation)
position.x = fmodf(position.x + 100.0f, 0.4f) - 0.20f;
(from a software implementation)
You have to give it some offset (the 100.0f) because the values below zero fuck up with the fmod (i think).
position.x = fmodf(position.x + 100.0f, 0.4f) - 0.20f;
position.y = fmodf(position.y + 100.0f, 0.3f) - 0.15f;
gives a wall of for example cubes :)
position.y = fmodf(position.y + 100.0f, 0.3f) - 0.15f;
gives a wall of for example cubes :)
aah yes...negative numbers and modulos...long time ago that i last ran into this prob !
sometimes one forgets about the easiest stuff there is ! a coders life, always thinking too difficult !
thanxalot, its working now ! :D
sometimes one forgets about the easiest stuff there is ! a coders life, always thinking too difficult !
thanxalot, its working now ! :D
Nice! :)
nigga, plz: "position.xy = (position.xy - floor(position.xy)) * vec2(0.4, 0.3) - vec2(0.2, 0.15);"
kusma wins!
Kusma: it was a simple software renderer (c++) experiment made in 5 minutes.
kusma, plz: "position.xy = frac(position.xy) * float2(0.4,0.3) - float2(0.2,0.15);"
Well, looks like we've got ourselves an old-fashioned code-off, gentlemen!
Please, keep it nice and clean.
*Covers furniture in plastic*
*Covers furniture in plastic*
ryg, plz: "position.xy = fract(position.xy) * float2(0.4,0.3) - float2(0.2,0.15);"
ok, self pwn... in GLSL it's fract, in HLSL it's frac.
plz:
D3DXRenderAwesomeScene(0x43874834, D3DXCOLOR_REDDISH, D3DXMESH_SPHERES | D3DXMESH_CUBES | D3DXMESH_PLANES, D3DXAWESOME_VERY);
// first number is seed
D3DXRenderAwesomeScene(0x43874834, D3DXCOLOR_REDDISH, D3DXMESH_SPHERES | D3DXMESH_CUBES | D3DXMESH_PLANES, D3DXAWESOME_VERY);
// first number is seed
ryg: Indeed. It's what I originally wrote, but I got struck by temporary insecurity about how it dealt with negative numbers and bailed out.