DirectX 9 & Shaders

Community Forums/Showcase/DirectX 9 & Shaders

Sweenie(Posted 2004) [#1]
Could you please download this Blitzdemo and see if it works on your computers?
Requires Pixelshader 2.0, VertexShader 2.0 and at least DirectX 9.0b to work correctly.

The vertexshader might work on "Nonshader cards" since I switch to Software Vertexprocessing if the card doesn't support Hardware Vertexprocessing(But the teapot will be unlit).

Press Space to switch wireframe on and off.

Shadertest


Ezbe(Posted 2004) [#2]
.Exe works great (nice effect, great job!), can't run the code (Function GetActiveWindow() not found). I have the .decls and the dll in the userlibs -folder, so I'm guessing the GetActiveWindow is in some other lib.


Sweenie(Posted 2004) [#3]
Create a new declsfile called user32.decls or something.
Then add these lines:

.lib "user32.dll"

GetActiveWindow%():"GetActiveWindow"


Ezbe(Posted 2004) [#4]
Lol, I actually had the "GetActiveWindow" in user32.decls, but the function name in blitz was HasFocus()... =P The code runs fine. Is this really it... the answer to our prayers? Shader-support for Blitz? =))


Sweenie(Posted 2004) [#5]
Yes, this is shaders in Blitz.
But so far I'm doing this for my own purpose.
I will wrap DX9 parts as I need them.

I believe there is a DX9 engine in the makings and I would suggest waiting for that one, or VividGL if you prefer OpenGL.

Consider this demo an example of what can be done.


Dock(Posted 2004) [#6]
The teapot is completely black. Hmm.
Is the Geforce 4 ti4600 not good enough for the demo?
Which cards qualify for shader level 2?

Interesting approach though, I think it's cool that you're experimenting with ways of achieving this with Blitz.


Paul "Taiphoz"(Posted 2004) [#7]
All I see is a green teapot, nothing special looking, also its slow as death on ma computer, about 3 or 4 frames per second in wireframe mode.

and a little faster in none wireframe mode.

xp21 - GF5200 256 meg - 512 meg ddr 400 memory


mongia2(Posted 2004) [#8]
work fine....is a best render...


2800+ 512 ram
nvidia 5700

thanks
Mongia


Rob(Posted 2004) [#9]
Works fine and is very fast. interesting mouse move effect :)


Red(Posted 2004) [#10]
Black teapot ?

GeForce Ti4200


smilertoo(Posted 2004) [#11]
Works well here.


Sweenie(Posted 2004) [#12]
You should see a green teapot with some specular light on it.(Lit by the pixelshader)
When you move the mouse over the teapot it should "stretch" depending on the mouseposition.(Done by the Vertexshader)
If holding down the left mousebutton the "stretcheffect" should be inverted or something like that.

I don't think the Ti4200 cards support pixelshader 2.0

The GF Fx 5200 should work since that is what I have.


Rob(Posted 2004) [#13]
how are heat shimmer effects done, do you know? I ask because when I've seen them in far cry and doom3, they seem shaped especially - as if a bunch of 3D models were creating the area of effect.


Sweenie(Posted 2004) [#14]
I'm not sure, but it you have Doom3 try and see if you can find the files referenced in the script below...
vertexProgram heatHazeWithMask.vfp 
vertexParm 0 time * 0.1 , time * 0.5 // texture scrolling 
vertexParm 1 1.5 // magnitude of the distortion 
fragmentProgram heatHazeWithMask.vfp 
fragmentMap 0 _currentRender 
fragmentMap 1 textures/sfx/vp1.tga // the normal map for distortion 
fragmentMap 2 textures/sfx/vp_full.tga // the distortion blend map 
} // End Heat Haze Effect 



ckob(Posted 2004) [#15]
Sweenie your the best :)


HNPhan(Posted 2004) [#16]
wow, you rock :D
too bad it works only on shader 2.0 cards


Red Ocktober(Posted 2004) [#17]
ok,ok... so what's going on here...

someone tell me... slowly, for the above 50 inquiring mind...

i was just about to spend $69 and license DBPro 'cause of my curiosity about all this shader crap...

are ya tellin me that we can do it in Blitz now!!!!!????!!??!

i'd say arrrrrrgggggggg if i wuz a pirate that is...


--Mike


joncom2000(Posted 2004) [#18]
"i was just about to spend $69 and license DBPro 'cause of my curiosity about all this shader crap..."

From what I have read over on the DBpro forums it might be better to save your money, not alot of them see to have much success with using shaders in DBpro. It's one of those many listed features that appears to be somewhat unstable. Thats of course if the posters in the forums aren't just complaining for the sake of it. I don't have DBpro but the demo didn't work very well last time I tried it and shaders were "broken" ;)


Red Ocktober(Posted 2004) [#19]
thx jc... i played with the demo too... seems the .fx files have gotta be edited to get a compatible shader working...

... but what have we got here, shaders for Blitz3D???

you know, i've really gotta get off my arse and start getting serious about some of this stuff...

--Mike


Dreamora(Posted 2004) [#20]
I own DBP and you better save your money for something better ... the FX system is a large collection of bugs and incompatibilities


Zmatrix(Posted 2004) [#21]
Works here, nice stuff Sweenie :)
gFX 5900u


@Mike, Dreamora is right about DBP, its too unstable.
An effect may work for a few min..then for some unknown reason...just stop. heh

you might want to check out something like:

http://www.ogre3d.org/
just a renderer, not a game engine.

http://axiomengine.sourceforge.net/
built around oger, but has some more Game-centric stuff.

http://www.4drulers.com/amp.html
Nice engine, little pricey...but very nice.
looks FPS centric...so I dunno about a sub sim ;)

http://www.devmaster.net/engines/
check out those and alot more here.

Tse isnt really ready for prime time yet.
but it looks good for what it has.

Zmatrix


Paul "Taiphoz"(Posted 2004) [#22]
if it was full screen m8 we could give you an accurate fps reading using fraps, or you could just add an FPS counter to it so we can report back how fast it really is running.


Red Ocktober(Posted 2004) [#23]
Thanks Sam for the links... i'm familiar with ogre... and i've heard of axiom, but haven't stopped to play with it yet...

TSE does look hot... but, like you said, it's gonna take some time before you can (or would want to) release anything done with it.


i'm just curious about a few things, and the OnLine version of DBPro is only $69... so i did it...

i plan to upgrade my 3dgs license also in a week or so...


it seems that everyone uses a different implementation of shaders during what to me seems to be the transition period follow the release of D3...

since i'm trying to learn the fundamentals of coding pix and vert shaders i'm gonna be suckered into spending a few bucks again, just to satisfy my curiousity...

and thus the interest in this thread.

--Mike


Dreamora(Posted 2004) [#24]
And wherefore do you need a shader engine exactly?

For shadertesting there is a shadertestapp with the DX9 SDK. The only thing I knew that has NO problem to load and show shaderfiles by the way :)

and for shaders, you need the high level shader language reference manuals. ( depending which you are planing to learn. DX or OpenGL )

And the 70$ for DBP: wasted money. they work different on every 2nd gpu ( at least if they work ), lot of FX won't even work due to the overbugged implementation.


Red Ocktober(Posted 2004) [#25]
and which dev tool available today implements shaders that work 100% on 100% of the graphics cards out there D...

and i'm not look for a shader tester... i have the SDK... and Rendermonk, and FXwhateveryoucallit...

i'm just curious to see a level in one of these low end dev tools with some shader effects...

and please, lets not start the Blitz vs DBPro religious wars again... i'm getting really kinda tired getting it from the Blitz religious fanatics on this end, and the DB religous nuts on the DB forums...

i have no religious affinity to any one of these tools... i am a 3d heretic!!!!

there... i said it... now you may proceed with the stoning....

--Mike


Zmatrix(Posted 2004) [#26]
He's one of them DBPRO people,,,lets stone em and sacrifice him to our GOD! ..heh

hey DBP may actaully get along with your system config..but wouldnt want to support it on others ...cuz like dreamora said....somtimes it just doesnt work.

I guess you've seen this
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6431

I thought about putting it in,
and might after I get some stencil shadows working.

EMBM might be more usefull in a static(light and shadow)render , because its an emulation of reflective light that would change with perspective.


Zmatrix


Red Ocktober(Posted 2004) [#27]
I got your email... THANKS heaps man...

i downloaded the bumpmapping stuff but haven't recompiled it into the engine yet... also read where some guys had a lil difficulty with it, but it should work ok...

lemme know how you make out with it.

1.3 demo should be out soon, i haven't had a chance to dl and compile the 1.3 code yet, but i'm anxious to see the new editors in action, so maybe this weekend.

yeah... DBPro is problematic... and besides the possible compatibility issues, i really do have a small problem with making a program that forces a user to have the latest updated hardware and OS in order for it to run on...

... after all, i aint id.

anyway, THANKS Again...

--Mike


Nikko(Posted 2004) [#28]
demo works fine with FX5200 NVidia.
maybe someone could publish some source code, so every one will team up to set the shaders with blitz?


Jeremy Alessi(Posted 2004) [#29]
Cool ... it's just morphing ... kinda looks like you could do some refraction there though.


Bot Builder(Posted 2004) [#30]
Awesome sweenie, awesome...... Nothing you couldn't do with high poly meshs and a fast AGP but eh :P

<chant>We want refractions! we want refractions!</chant>
<chant>We want displacement maps! We want displacement maps!</chant>


N(Posted 2004) [#31]
<chant>We want displacement maps! We want displacement maps!</chant>


Hehe.. trust me, at this point in time, noooo you don't.


Red Ocktober(Posted 2004) [#32]
would ya settle for some DX8 based vertex shaders that everyone can use... :)

i mean, this vertex/pixel shader madness that we're all suffering from now... where will it end!!!

have we all gone mad...

what about the people sitting around depending on us indies to make em a good game that they can run on their GeForce 2 550 mHz speedsters...

what about them... huh, oh,

uuhhh, excuse me... i've gotta run to Circuit City before they close...

wifey's buying me a new FX5200 or some other up there gpu for my birthday (which is still a month away)...

:) :) :)

so... what was i saying :) :)


--Mike


DrakeX(Posted 2004) [#33]
pretty cool. too bad you have to write an entire graphical engine to use them :P unless you're just doing something small.

if only B3D natively supported DX8/9! if only BMax would ship with an engine! sigh..


Bot Builder(Posted 2004) [#34]
Hehe.. trust me, at this point in time, noooo you don't.


Hehe. I know... still... :D You gotta admit they're fun to mess with.


AntonyWells(Posted 2004) [#35]
Red, don't get a 5200, get a 5600xt(Bout the same price give or take a score, yet much better. 5200 is slower than a g3.)

Sweenie, works nice and fast here, lit properly. Pix shader 2.0 card.


Red Ocktober(Posted 2004) [#36]
roger copy SpacedMan... thx...

--Mike


trash(Posted 2004) [#37]
Funny one :D... like that mousemove thingy (what kind of drugs do u need to see something like THIS? ;) )

Athlon2,6+, GF6800Ultra,2GB Ram