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.

DarkBASIC Professional Discussion / www.cgshaders.org on converting from .cg to .fx files

Author
Message
DMXtra
23
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 25th Aug 2003 13:27
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.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Aug 2003 17:01
cgc "filename.cg" -fx

thats all you need, and really it'll most likely just change the extension fromm .cg to .fx in most cases.

David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2003 17:09 Edited at: 25th Aug 2003 18:39
NVidia have included loads of .fx files in their CgFx viewer (103mb - http://developer.nvidia.com).

Included are a couple from DBPro's FX view example, maybe suggesting that they got their shaders from there too

My problem is adding the tweakables - I might email Lee later today about converting 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.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 25th Aug 2003 17:12
A vast majority of those nvidia shaders are basically tricks or designed for one specific task. I.e. you'd find a "fur" shader that works on the supplied model and looks pants on anything else. Be prepared for a lot of re-coding if you want to use pretty much any of them in a game, I know for sure all the ones we've provided so far have been worked on in order to be useful beyond their original design.

Cheers,

Rich

"Gentlemen, we have short-circuited the Universe!"
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2003 18:42 Edited at: 25th Aug 2003 18:43
Rich,

I know alot of those were just for showing-off purposes. (I wasn't really expecting any to work either )

Quote: "If you
have an FX file that does not work, and you would like to see working under DBPro, please send it to us
with all the required media and an explanation of what you think the FX file does. We will endevour to
correct the file for inclusion into our library which will be made available at some future date."


I might just act on that


PS - although I'm pleased I got that simple.fx shader working in my game bit useless though if it only works on round models!

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: 25th Aug 2003 21:21
Out of all the .fx files i found in the cg viewer about 90% don't work i have not tested them all yet, who is that a quote from david89?

David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Aug 2003 21:43
The DBPro help files (technical documents).

Quote: "Out of all the .fx files i found in the cg viewer about 90% don't work i have not tested them all "


Do they not work in DBPro of the viewer? MOst worked for me - only a few didn't that used DX9. My (lowly?) ti4800 doens't have DX9 blood

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: 25th Aug 2003 23:02
Do you mean the CG viewer or one made in dark basic? i have a Ti4200 so they most should work as i have full 8.1 support but i just though it must be that they are not compatible with dbp!

Login to post a reply

Server time is: 2026-07-23 00:32:29
Your offset time is: 2026-07-23 00:32:29