Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Startopian
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 24th Aug 2003 16:29
Hi, I have never quite understood how Db Pro users can use this technique. The example code does nothing. I have heard you have to write your own shader routine, but come on! How are most people who use DB Pro for a hobby going to do that!! DBS should provide some shaders for us to use. I have just got patch 5 down and can see no new shader commands as yet. Anyone got anything besides the rainow shading and stuff to work? all I want to try is a water effect like in Morrowind and the 3d mark demo's. I want to see how DB Pro handles them. It says on the home page water effects so I assumed it had been put in as a new standard effect. But I can still only see the old effects and some lighting ones, which I have never found to be much use as of yet.

Sorry if I seem like I'm ranting, but ever since Pro was announced they promised pixel shading support and so far (almost a year now since launch) I have seen didly squat.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2003 17:29
1) Try the "FX" showcase example (under basic3d) - that has some really good metallicly effects

2) I think pixel shaders for morrowind water, etc weren't just plug-n-play routines. I don't think it woeuld be possible to download a file, load it and tada! realistic water. You could ask Raven about this, he seems to know alot about this kind of thing.

3) If you look in the U5 example (under basic3d examples) that has a very good cel shading pixel shader there:



And the cartoon.fx file:



There's no place like 127.0.0.1

There are 10 people in this world, those who understand binary and those who don't.
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Aug 2003 17:53 Edited at: 24th Aug 2003 19:30
shaders can do quite a bit for your software, as far as I know (since my card doesn`t support them) you can use the shaders off this site as fx files and have some realy serious effects, but your card will have to support them in the first place, and my poxy MX doesn`t.

http://www.cgshaders.org/shaders/

Mentor.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Aug 2003 19:37
Mentor: thanks for that site I was looking for some

There's no place like 127.0.0.1

There are 10 people in this world, those who understand binary and those who don't.
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 24th Aug 2003 19:43
yeah thanx, think i may have found what i was looking for.

lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 24th Aug 2003 21:38
can dbp only load .fx files or can it load d3d and cg formats?

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Aug 2003 22:01 Edited at: 24th Aug 2003 22:02
I think they had a help session on this somewhere and said you just have to modify parts of the code in some cases to initialise it correctly, but where it is I have no idea, try a search of the site, as far as I know Pro uses the directx fx system but Nvidia developed that alongside Microsoft, so it should be more or less the same as the Nvidia fx files (or maybe IS the same, like I say I can`t try them on my card )

Mentor.
DMXtra
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 25th Aug 2003 09:36
As of right now DBPro can ONLY use .FX files (DirectX 9 high level shading language files). You have to convert .CG (Nvidia's shader language which is almost the same as microsoft's HLSL) files over.

Take a look at a .FX file and then go to www.cgshaders.org to get some .CG files and then compare them.

Dark Basic Pro -- The luxury for game programmers everywhere
MushroomHead
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 25th Aug 2003 12:27 Edited at: 25th Aug 2003 12:28
Quote: "shaders can do quite a bit for your software, as far as I know (since my card doesn`t support them)"


From what I'm told, on cards that do not support vertex shaders, the shader code is run on the cpu so in theory it does work (hence Nvidia's claim to shaders on a bog standard GF4 MX is right after all). Obviously running code on CPU will affect speed of program ... for pixel shaders, it's an entirely different matter and requires hardware pixel shaders to work.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2003 13:17 Edited at: 25th Aug 2003 17:15
Quote: "As of right now DBPro can ONLY use .FX files (DirectX 9 high level shading language files). You have to convert .CG (Nvidia's shader language which is almost the same as microsoft's HLSL) files over.

Take a look at a .FX file and then go to www.cgshaders.org to get some .CG files and then compare them."


NVidia has released a cgfx toolfit which contains many .fx files - I'll be testing it soon.

There's no place like 127.0.0.1

There are 10 people in this world, those who understand binary and those who don't.
DMXtra
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 25th Aug 2003 13:25
This is from www.cgshaders.org on converting from cg to .fx files

"Sure, just place it into an .fx context.

The .fx file format is just a "wrapper" for one or more Cg shaders, so that the shaders can be easily shared by applications. So to convert a cg shader to an fx shader, copy it to a new file with the .fx suffix, then add:

* Declarations for the shader's uniform parameters ("tweakables")

* A technique declaration that compiles and calls the shader

You can find examples of tweakables and techniques in any existing .fx file"

Source: http://www.cgshaders.org/forums/viewtopic.php?t=1555

Dark Basic Pro - The Bedroom Coder's Language of choice for the 21st Century.
Startopian
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 25th Aug 2003 15:21
Thanks everyone, seems theres a bit more info about now. I'll have to have a look at some of the sites you have mentioned. I have had a Geforce 3 for ages now and have always wanted to try out the pixel shaders in Pro but not had any luck. I now have a 5900 Ultra so I definatley want a few files to test!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Aug 2003 17:11
Quote: "From what I'm told, on cards that do not support vertex shaders, the shader code is run on the cpu so in theory it does work (hence Nvidia's claim to shaders on a bog standard GF4 MX is right after all). "


this is only true if the developer allows it.
GeForce2mx, GeForce2GTS, GeForce4mx cards can also utilise Fixed-Function Shaders ... but again you need to allow th engine to acccept this. Particularly in Direct3D which you need to set the Device mode to Mixxed Hardware Processing, rather than Pure Hardware Processing.
But the problem with this is even if you don't use shaders it reduces overall speed.

Quote: "As of right now DBPro can ONLY use .FX files (DirectX 9 high level shading language files). You have to convert .CG (Nvidia's shader language which is almost the same as microsoft's HLSL) files over."


this is also not entirely true, you can still program shaders in native ASM with far more control over what goes in and out of them right and will work with versions 1.0/1.1/1.4/2.0/3.0
which is probably actually a better starting point.

Also it seems quite stupid to start working with Cg, if you don't already understand the differences between Cg & HLSL it is best to just stick away from Cg and just learn HLSL.

Though to be perfectly honest i don't see that anyone here is really ready to mess around with Shaders considering most of you can't even understand simplistic things like Memblocks & Data Pointers ... and i'd strongly suggest before you get into the low level 3D side of thinks you actually learn 3D properly to start with.

Not that anyone is gonna listen, cause no doubt the call of making your own bump mapping will seem more alluring - but it'll be ALOT simpler to produce the effects you want if you atleast know what every aspect of the 3D is doing in the first place.

lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 25th Aug 2003 21:26
@DMXtra could you use the same code to convert a Cg shader to an fx shader for all cg shaders or do they require different perameters?, I know a lot of the shader would probably not work but i would not mind testing a few out to see if i can get them working anyway.

Login to post a reply

Server time is: 2026-07-23 00:17:33
Your offset time is: 2026-07-23 00:17:33