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
headcrab 53
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 3rd Jan 2006 18:32
I know what shaders are and what kind of effects they can create, but I don't know anything about creating them or using them in DBPro. Can anybody help me to create a per pixel lighting shader and use it in DBPro?

"Not again!" - A Grunt
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 4th Jan 2006 06:39
Ninja Matt has a very nice normal map shader (several versions even) in the ultimate shader thread. That will give you per-pixel lighting and is a better option than trying to write a shader without knowing how.
headcrab 53
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 4th Jan 2006 16:37
I downloaded the shader. How do I use it in DBPro?

"Not again!" - A Grunt
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 4th Jan 2006 21:36
If u read the shader thread it explains there.
If u read the help files it also explains there

From the help files
Quote: "
SET EFFECT ON
This command will load and apply an FX file to an object. If the object does not exist onto which an effect is set, a default model is created either specified by the FX file or if none is specified, an internal pyramid model. The FX filename must point to an FX file that is compatible with the DX9 effect framework and typically uses the extension '.fx'. If the Texture Flag is set to zero, the effect will use the textures already mapped to the model, and a value of one will discard the current textures and load the textures specified in the FX file. Typically, effects rely on the specified model and textures in the FX file to function properly.

SYNTAX
SET EFFECT ON Object Number, FX Filename, Texture Flag"


OR else use these two commands

Quote: "LOAD EFFECT
This command will load an FX file.
SYNTAX
LOAD EFFECT Filename, Effect Number, Texture Flag

SET OBJECT EFFECT
This command will apply a previously loaded FX effect onto the specified object. Using this command instead of SET EFFECT ON allows many objects to share a single FX system and increase the performance of your application.

SYNTAX
SET OBJECT EFFECT Object Number, Effect Number
"


The only fx files that I've ever seen working are the ones on the shader thread.

Take care
AtomR
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 8th Jan 2006 01:05
Sorry for the delay, I was gone for a few days. Just got back from Vegas and actually slept so I can think now. It's actually not as easy as just LOAD EFFECT and SET EFFECT ON...this shader has some things that need to be set from your code to make the shader read properly.

I'm leaving right now so this will be quick and I don't remember how much of this Ninja Matt covered in that post, but here's some things to keep in mind. One is that the latest version of the shader he posted had several techniques and supports multiple lights. Check in there for some code, if there isn't any I can write some up later. But it's important to know how to load it on there and control the lights and techniques. The other thing is for generating the normal maps. Get a program called Normal Map...or something equally obvious... from the ATI website. You make two models, one low poly, one with however many polys you want. That one has all the details that will be mapped onto the lower poly object. You then go through that program to generate the texture that will be mapped onto your object. This is not a diffuse colour texture, it's just the normal map. You need to provide the shader with a normal map texture as well as a diffuse colour map. Open up the .FX file in notepad and you can see in the beginning where it is loading the graphics files. Might be easiest to just change the filenames there for now. I'm pretty sure Ninja Matt posted some code to make it run...the normal mapped box. Look for that code and try it out. It would show you the other bits that need to be set in your code.

Hope this was some help, writing fast so I can get out of here and I don't know that I'm actually making sense. If you need more help, let me know and I'll post some working code and show you more what to look for in the texture files.
White knight
20
Years of Service
User Offline
Joined: 31st Dec 2004
Location:
Posted: 8th Jan 2006 22:28
to use pixel shaders look at the sourcecode in the shader thread they have some examples on how to use shaders in dbpro which are very good examples there is alot of examples in that thread to learn from yes it may seam complicated at first when you first read though the thread but in fact it's easy to use in dbpro basicly all shaders are is code that milipulates the texure in hardware mode as long as the hardware can read and use the code in the .fx files or what ever pixelshader file.

Login to post a reply

Server time is: 2025-06-06 17:14:03
Your offset time is: 2025-06-06 17:14:03