Skip to main content
GameDev.net gamedev.net
🔒 Locked

Shader System

Started by Chamu256 Mar 27, 2007 at 10:57 AM 2 replies 1.4k views
Original Post
Chamu256
Chamu256
Hy all, Im trying to implement an effect file based shader system. But its not so easy. After thinking a few hours. I ended up with 2 similar solutions.And I don`t now wich one to choose. 1] We have an effect file for each render path(dx7,dx8,dx9...) wich contain several techniques. Each technique will do different things. There will be one technique for drawing static meshes other for drawing animated meshes, and other for drawing skyboxes..... Sub mesh classes will store material info(like diffuse color, textures and the name of the technique that we have to use for rendering) Then i will use a render queue to sort sub meshes by technique and material. 2] The second version is similar. We have many effect files. One effect file contains technique for renderig static mesh, another effect files contains technique for rendering animated meshes... Sub mesh class still store material info but this time but instead of technique name itt will contain the name of the effect file. Then i will sort the sub meshes by effects and material. I forgot to mention that in 2 version could contain 3 techniques one for dx7, one for dx8 and one for dx9. Please Help!! PS: Sorry for bad english :(
Endar
Endar
I think that every mesh, or every entity that needs a technique should contain the name of the technique.

A good idea might be to have many fx files, each that define something important, like an fx file for per-pixel lighting. Then, in that file have several techniques, one each for the different shader versions. Instead of having one for dx7, dx8 and dx9, you should have one for pixel shader version 3, one for pixel shader version 2, 1.4, etc, etc.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
coelurus
coelurus
How about writing one effect file for each possible case regarding both effect and implementation? Gonna be a lot of effect files, so just split up them up into different directories by implementation.
This is very much a decision you will have to make, it's mainly a small organizational issue that determines how the effect development will work. Doesn't affect the higher level of the rendering process, so just choose one for now.
Chamu256
Chamu256
Thanks for the response,

I will implement the second version than.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.