pouët.net

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!
added on the 2009-10-07 15:35:25 by Rob Rob
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
added on the 2009-10-07 16:12:44 by BarZoule BarZoule
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.
added on the 2009-10-07 16:15:17 by Rob Rob
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.
added on the 2009-10-07 16:17:16 by Rob Rob
Have you tried JavaScript?
added on the 2009-10-07 16:17:32 by kusma kusma
*rgba_slisesix
added on the 2009-10-07 16:17:51 by Rob Rob
Kusma, I will give it a shot ;)
added on the 2009-10-07 16:18:11 by Rob Rob
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 !
I am not using noise() but my own implementation!

I will give rendermonkey a shot. Thanks again.
added on the 2009-10-07 16:39:31 by Rob Rob
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 ?
this works for me:

position.x = fmodf(position.x + 100.0f, 0.4f) - 0.20f;

(from a software implementation)
added on the 2009-10-07 16:56:01 by Rob Rob
You have to give it some offset (the 100.0f) because the values below zero fuck up with the fmod (i think).
added on the 2009-10-07 16:57:12 by Rob Rob
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 :)
added on the 2009-10-07 16:59:18 by Rob Rob
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
Nice! :)
added on the 2009-10-07 17:09:17 by Rob Rob
nigga, plz: "position.xy = (position.xy - floor(position.xy)) * vec2(0.4, 0.3) - vec2(0.2, 0.15);"
added on the 2009-10-08 00:57:30 by kusma kusma
kusma wins!
added on the 2009-10-08 09:03:10 by xTr1m xTr1m
Kusma: it was a simple software renderer (c++) experiment made in 5 minutes.
added on the 2009-10-08 10:11:40 by Rob Rob
kusma, plz: "position.xy = frac(position.xy) * float2(0.4,0.3) - float2(0.2,0.15);"
added on the 2009-10-08 10:41:30 by ryg ryg
Well, looks like we've got ourselves an old-fashioned code-off, gentlemen!
added on the 2009-10-08 10:54:44 by gloom gloom
Please, keep it nice and clean.
*Covers furniture in plastic*
added on the 2009-10-08 11:51:16 by sagacity sagacity
ryg, plz: "position.xy = fract(position.xy) * float2(0.4,0.3) - float2(0.2,0.15);"
added on the 2009-10-08 11:54:41 by xTr1m xTr1m
ok, self pwn... in GLSL it's fract, in HLSL it's frac.
added on the 2009-10-08 11:55:13 by xTr1m xTr1m
plz:

D3DXRenderAwesomeScene(0x43874834, D3DXCOLOR_REDDISH, D3DXMESH_SPHERES | D3DXMESH_CUBES | D3DXMESH_PLANES, D3DXAWESOME_VERY);

// first number is seed

added on the 2009-10-08 12:03:02 by Rob Rob
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.
added on the 2009-10-08 12:09:13 by kusma kusma

login