pouët.net

Go to bottom

Help with my very first shader program

category: general [glöplog]
Premium: At these rates, any minor thing can cripple the FPS. Don't consider these exact numbers. Also rememver THESE WISE WORDS.
added on the 2009-10-07 14:34:01 by kusma kusma
thx kusma, for me as non coder it looked bit strange. :D
added on the 2009-10-07 15:57:34 by Premium Premium
I've finally bought the GTS250 and it is a beast. I'm amazed.

The shader is probably very unoptimized and full of branches (and I've not even used SIMD for it, just pure floats and ints), and anyway it is going 20x as fast as a multicore highly optimized version for CPU in my core 2 duo 2ghz.

I mostly want it for GPGPU, and I'm sure I'm going to have a lot of fun with it.

Again, thanks so much for testing :)
added on the 2009-10-07 21:37:16 by texel texel
I was expecting to get the fallo because everything works today (bad luck) and I got a fallo on an ATI HD 3650.
added on the 2009-10-07 21:49:46 by Optimus Optimus
I wanted to write "because nothing works today" but I failed. Even this doesn't work. Also, I just shit my pants and there is no toilet paper around.
added on the 2009-10-07 23:04:46 by Optimus Optimus
PANTS OFF!
added on the 2009-10-07 23:09:16 by havoc havoc
i also got the fallus error on my ATI mobility HD 3650.
whynot2000, Optimus Knight: are you still with Catalyst 9.3? Try the 9.8 hotfix (rather bloated but works great on my brothers HD 2400 Pro AGP without having to change the device ID's to install).
Gefore 8800 GTS: 900-1600 fps
added on the 2009-10-08 00:16:32 by hfr hfr
WarriorAtWar: i will not do such thing, it seems it only fixes 4 games, none of which i play, and it mostly fixes luxery stuff like AA and being able to use the Ultra setting.
i don't like AA, it looks like using 800*600 on a modern LCD screen in games.
whynot2000: That's what they say...
It fixes allot of stability issues (like micro stuttering and video tearing) and improves performance in a wide range of scenarios compared to 9.3 (LifeForce now works on my brothers computer with 9.8, Rapture is not a simple "black screen with audio" and Raytro by FRq handles better, not to talk about Source engine games and SF4).

Anyway, without wanting to hijack the thread:
HD 2600 XT 223~537 FPS
I installed the new drivers and that's a good thing but I still get feloni.
added on the 2009-10-08 01:29:28 by Optimus Optimus
WarriorAtWar: 9.8 was a great fix, thanx for pointing it out!
but i still get the same error
interesting, I installed the DirectX SDK and now the program works... For those DX experts: why?
added on the 2009-10-08 17:37:20 by iq iq
iq: did you have d3dx9_31.dll installed before?
added on the 2009-10-08 17:53:19 by Gargaj Gargaj
iq: did you got the e-mail I sent you with the full code?

And also, the modifications I did to your code, that can be what makes you need something you had not installed, maybe:

- I changed from sm2 to sm3 in your 1kb shader example
- I added a vertex shader to be able to use sm3.
- In main_deb.cpp I changed from "ID3DDevice9 *d3dDevice;" to "LPDIRECT3DDEVICE9 d3dDevice". I have no idea of what this means, but was the only way to be able to the next point.
- I'm sending data to the shaders this way:
if (handle = ct->GetConstantByName(NULL, "z3")) ct->SetFloat(d3dDevice, handle, z3);

Being handle a D3DXHANDLE and *ct an ID3DXConstantTable.

Then, the shader is very long. In my ATI 1650SE, there is a do-while loop that I could set to a maximum of looping of 30-40 times, if I added more, I got "fallo" when compiling. In my new 250GTS, it looks that I can set it much higher and it works... So maybe that also affects.

The thing is, it doesn't look to be a problem with the ATI or NVIDIA, since the code worked in a shitty ATI and also in a new NVIDIA...

Then, you tell me that installing DXSDK it works... it is weird... but I can think that maybe I'm using any function that requires certain version of the dlls or DX, or, maybe, in my shader code I'm using something that compiles bad with some version of the dlls, and works fine in the latests... or I don't know...

If you think it is worth to investigate, I will publish the full source... or since you have it yourself, I allow you to do it too.

Also, I think if we can do it right, a SM3 sample would be great in your pack of intro samples, and probably also a SM4 sample too, so maybe we can use this.

Trying to search for good and easy samples to do anything with pixel shaders, your samples are the only ones easy to understand in the whole internet... I really think your samples deserve to be updated and to add some more information... like somebody said in other thread like a "NEHE for pixel shaders".
added on the 2009-10-08 21:40:37 by texel texel
iq! The unpaid tutorer of the demoscene!
added on the 2009-10-08 23:36:20 by kusma kusma
ps2 doesn't have a loop instruction, so the hlsl compiler was probably unrolling it. Also, the instruction limit is pretty low.
added on the 2009-10-09 02:39:26 by Nezbie Nezbie
400-900fps in ATI HD4650
It also worked when I installed dx sdk.
added on the 2009-10-09 10:55:21 by Optimus Optimus
According to several sources, when running a prod windowed x2 atis runs that with 2d clocks. Ok, installed 9.9 drivers to my 4870 x2 and enabled "force maximum clock". So your test demo came from 793-1200 to 2200-3100.

Why, because of your product runs windowed and seems that it is the Ati/amnd driver problem. Make it fullscreen and, oh, ati performs a lot better!


added on the 2009-10-09 17:46:06 by moredhel moredhel

login

Go to top