Game Development Community

Shaders - I'm almost there I think

by Nigel Budden · in Torque Game Engine · 08/20/2003 (3:50 am) · 16 replies

I have placed in all the extensions, added the dll and log functionality stuff, I can successfully test to see if the card supports Vertex Programs or not, and out put the result to the Console.

However and here lies the rub, I don't know which objects I should be placing the VP and FP functionality inside of, I was looking at tsShape and tsShapeInstance, however I'm not sure if thats where I need to add the code. Does anyone have any hints which could point me in the right direction?

Thanks in advance Guys

Nigel 'Soulos' Budden

#1
08/21/2003 (9:09 am)
You'll want to look at the render* functions. Objects in general are responsible for their own rendering. 3space is more of a helper library; if you trace through an object's render function, you'll see how it's all hooked in.
#2
08/21/2003 (5:11 pm)
Look for the material loading part where it sets the textures and such. I'd stick it in there.
#3
08/24/2003 (1:08 am)
Sounds like a plan pat, I'll look into it. Thanks for the responses guys.
#4
08/27/2003 (6:43 am)
Hey Nigel, any news or updates from the shader front? If you need any help or got stuck anywhere, just give a shout.
#5
08/27/2003 (8:19 pm)
Just in the process of getting it to work on Nvidia cards atm, as the arb extensions are not working for some reason, may be a driver issue, may be a code issue, hope to have it resolved shortly, and some better information about them by the end of next week if you can wait that long :o)
#6
08/28/2003 (7:22 am)
Does it work on linux/mac? :)
#7
08/28/2003 (7:27 pm)
@Stuart: In theory it should... it's just an OpenGL extension
#8
09/12/2003 (2:17 am)
Bumping this thread.
#9
09/12/2003 (11:14 am)
Ok, you want shaders? I've integrated them into torque, but the only catch is that D3D support is ripped out because I just don't have time to write a D3D wrapper for this kind of thing.

hobbiticus.acm.jhu.edu/platform

There's a partial directory structure for torque in there. I might have missed some files. If so, post here, and I'll see what I can do. For anything else, I'm not supporting this. I did take out anything D3D related, so if you get errors, and it has something to do with D3D, rip out the "infected" areas. I also ripped out chunked textures, but that shouldn't be a problem, except for the gTexManager, perhaps. Again, just rip out anything that has to do with that if you encounter trouble.

And never fear, GG people, the source posted is NOT public in any way - only the people reading this forum know about it. If it's a problem, I'll take it down.

Also, these files are based off of head as of a few weeks ago, so some things might be outdated or incompatible. Again, I'm not supporting this because I simply don't have the time.

EDIT:
Oh, and the functionality that I've added to the engine will NOT be made public, because it's probably going to be used in a for-profit project. I might be willing to trade, however, if the appropriate offer is made :)
(Calculating tangents and binormals on ts objects would be a good offer :) )
#10
09/23/2003 (4:08 am)
Chris
As a dump 2D/3D artist, i dont know, what is the files are in your download link, Chris, but im very interesting about "shaders".
(waaaaaaooo....)
Can you write a few lines about, what this extension exactly is, and how its to install ? Ofcourse, not like a support, just an answer for a question in this thread :)

Im interested to give you an order if it is usable in our projects, im, and my company always looking for as much graphical extensions to TGE, as we can get.

Thanks4reading :)
Gabor
#11
09/23/2003 (6:43 am)
Vertex and fragment programs are commonly reffered to as "shaders" (as that is what DirectX refers to them as). Shaders intercept (sort of) the fixed function pipeline, and instead run through developer written programs, which allows for a great amount of flexibility and, uh, coolness.
#12
09/23/2003 (6:48 am)
Read this Chris's contribution is going to be of practically no use to artists without someone on their team that can apply the changes, and add support to the 3D exporters.
#13
09/24/2003 (9:57 am)
@Jarrod. I dont wanna to USE it. Im here at this thread, just becouse at the moment im a data-miner about the TGE. Im looking for add-on graphical solutions (addon values) to the ongoing projects.
I know as much things about shaders, as i got (like a skilled, and experienced artist) in my last few years in the modern era of gamedev, but thats all :) im really not a programmer.

Ive heard about the CG language developed by nvidia, but still not clear what those things can do, made by Chris, and its looks like harder to get the knowledge just becouse im from a diferent class of the developer-race.
But (hey!) im still interesting :)
#14
09/24/2003 (10:37 am)
In a nutshell, it's a way to run simple programs on the video card instead of on the CPU. It lets you do a variety of effects fast enough to be used in an interactive game.

I didn't look too hard at the posted files, but it looks like Chris has added the necessary header definitions and such to use CG in torque. Handy, wish he'd posted it before I'd already done my own version. Wouldn've saved some wear on my keyboard. ;)

As Jarrod mentioned, it's useless to anyone who isn't an openGL/Cg programmer.
#15
09/26/2003 (9:09 am)
What's provided is how to integrate the Cg functions into torque. From there on, it's your decision on where to do from there. You will need a decent coder to do anything with them, and just integrating what's provided will not get you ANYWHERE. However, i'll probably be releasing a content pack of things that you CAN do with them just by dropping them into your copy. However, it's going to be a little while.
#16
09/26/2003 (11:19 am)
Chris. Very cool idea :)
Im keep my eyes on you ;o)