Horde3D

Next-Generation Graphics Engine
It is currently 20.04.2025, 22:50

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Shader question
PostPosted: 29.10.2009, 08:53 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
Hi,

I want to render my model with a solid color, so I made a copy of model.shader and replaced the setting of albedo with a uniform parameter (which I can set in the material file).
My question is if this is the "right" way to do it? ... I mean to me it seems unrelevant if the color comes from a texture or a user-supplied value (I have though limited exprerince of shader programming)...
If this approach is OK I think it would be nice if the model.shader got updated to also support a user-supplied color value, so that it can handle either a user-supplied value or the color from a texture (as it is now)... maybe this could be handled with a new shader flag (#ifdef statement)?


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 29.10.2009, 09:09 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I guess normally you have textured objects in your scene, because simple uniform colors looks normally not very well in a professional scene. Maybe for quick testing and debugging a fixed albedo color is useful, but I'm not sure if we should add this to the default sample model.shader. After all I guess those shaders are only samples and not ment to be a swiss army knife, but that's only my personal opinion.

But concerning your solution for uniform colors, I think that's the way to go. I did it the same way in the color shader for the blender exporter (BTW, someone should update that shader to Beta4 :-) ).


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 29.10.2009, 09:48 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
My guess is that this shouldn't be that kind of special situation... you may want to mix simple models (with one color) with more advanced models (with textures) in one scene... at least that is what i want to do in my little game.
I think also that some newbies (like me) coming to Horde3D will look for this kind of support...


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 30.10.2009, 21:12 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Volker wrote:
I guess normally you have textured objects in your scene, because simple uniform colors looks normally not very well in a professional scene. Maybe for quick testing and debugging a fixed albedo color is useful, but I'm not sure if we should add this to the default sample model.shader. After all I guess those shaders are only samples and not ment to be a swiss army knife, but that's only my personal opinion.

I agree with Volker. A solid color is only useful in rare cases when aiming for realistic rendering and we shouldn't make the sample shaders overly complex. It can be useful for creating a special style (e.g. cartoonish) but then you need custom shaders anyway. However, for newbies such shaders can be added to Community Branch or their creation can be explained in the wiki.


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 31.10.2009, 08:39 
Offline

Joined: 19.10.2007, 09:12
Posts: 7
Location: Australia
How about adding a shader repository to the wiki?

_________________
Microsoft: "You've got questions. We've got dancing paperclips."


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 31.10.2009, 19:42 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
marciano wrote:
Volker wrote:
I guess normally you have textured objects in your scene, because simple uniform colors looks normally not very well in a professional scene. Maybe for quick testing and debugging a fixed albedo color is useful, but I'm not sure if we should add this to the default sample model.shader. After all I guess those shaders are only samples and not ment to be a swiss army knife, but that's only my personal opinion.

I agree with Volker. A solid color is only useful in rare cases when aiming for realistic rendering and we shouldn't make the sample shaders overly complex. It can be useful for creating a special style (e.g. cartoonish) but then you need custom shaders anyway. However, for newbies such shaders can be added to Community Branch or their creation can be explained in the wiki.


How would a "cartoonish" shader differ from the default sample model.shader, besides using a solid color?
(Just out of curiosity and because i'm thinking of using a "cartoonish" style in my game.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Shader question
PostPosted: 31.10.2009, 20:14 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Saypen wrote:
How about adding a shader repository to the wiki?

This is certainly a good idea! However, the content must mainly come from the community since we are already busy enough with the core system.

EsaK wrote:
How would a "cartoonish" shader differ from the default sample model.shader, besides using a solid color?
(Just out of curiosity and because i'm thinking of using a "cartoonish" style in my game.)

Usually the lighting is different, for example the number of shades is very limited or you have an exaggerated rim lighting effect. IMHO, one of the best looking non-photorealistic styles is used in Team Fortress 2. Take a look at their paper for more technical details.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group