Shaders

Shaders

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Grumble
Posts: 19
Joined: 16 Aug 2004, 08:29

Shaders

Post by Grumble »

Was just wondering what the deal was on Spring supporting modern shaders - namely normal and specular maps. I want to bring in some of my content and play around.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

I have no idea, but if you get it working... :twisted:

*nerdgasm*
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Both are supported I think, though they might be locked to the same chalsomthing (I cant remember). Theres no bump mapping though...
Unless you mean for Maps, in which case there will soon be bump mapping!

aGorm
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

If you want those please implement a proper material system first so we can put the shaders onto what actually needs them instead of having them apply to the whole model and masking them with a texture as it is now.
Grumble
Posts: 19
Joined: 16 Aug 2004, 08:29

Post by Grumble »

KDR_11k wrote:If you want those please implement a proper material system first so we can put the shaders onto what actually needs them instead of having them apply to the whole model and masking them with a texture as it is now.
AFAIK, that's the best way to control any type of shading - with a mask. It's far and away the most powerful way to control such things. Controlling by polygon would be kind of ridiculous, and I'm not sure what other grouping methods Spring has that would allow a better application. I know that in Supcom for example, the glow effect on their units is controlled with a mask.

Masks give you the finest level of control possible right now - per pixel. As long as you can deal with UV unwrapping, it's golden.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yes but masks mean the shader has to be rendered for the entire unit and then masked. That is VERY inefficient (especially since it means multiple passes per texture even if the shader isn't used by the unit at all and might even hit incompatibilities). Never mind that it'd force us to add a mask every time a new material property comes out.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

grumble, a proper material system does not mean per-poly materials.

IMO, Material systems are great and all, but in the current state of the engine I prefer just putting in normal map support in a relatively fixed way.
Ofcourse that would come after abstraction of the model rendering, so if anyone wants to implement a fancy material system they could still do that.

To answer the original question, neither are supported. The current specular highlight on units is rendered slightly unconventional, I don't know why.

I'm making some progress towards abstracting unit animation and rendering, and after that more model formats can be supported, and we can see what to do about normal/specular maps.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I'd prefer applying per-poly and if necessary adding a mask on top of that. That way I can prevent shaders from eating performance where they aren't needed. Would be great if we could get a material system as flexible as in Q3A or D3.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Changing shaders per-poly eats performance too. Usually rendering engines support material stuff per sub object/mesh.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

More importantly, most game engines have multi-texturing allowed as part of the model format, which means that per-pixel masking can be controlled over much smaller areas. That's one of the big limitations of the S3O format right now.
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

So, in another thread...

What texture channels are open, and where can I find the shader language reference manual? I am ready to start updating the shaders to support more features (and be easier to read).
Grumble
Posts: 19
Joined: 16 Aug 2004, 08:29

Post by Grumble »

mehere101: You might try getting FX Composer and Rendermonkey - they both have documentation and code examples. Both free as well, which is a bonus.
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

OK, so there is question two answered. My first question still stands
Post Reply

Return to “Engine”