3D Graphics

Moderators: Sephiroth
Number of threads: 274
Number of posts: 896

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to manage effects? Posted by Mihulik on 27 Dec 2009 at 3:49 AM
Hi,
I relative new in 3D graphics programing and I am confused how to manage effects.
I want to give option to users that use my api to add their own effects. I mean effect as combination of vertex/geometry/pixel shader and render states.

My first (and absolutely wrong I think) idea was that I do a lot of "mega-über-shaders" that combine every possible combination of effects. For example "NormallMappingAmbientOcclusionDiffuseAndBumpMappi ng shader".
Of course it is crap because there are so many possible combinations (and I am not even talking about limited number of instructions in SM3). Further, users couldn't add their own effects because they would have to rewrite every possible combination for their new effect.
So, it's wrong.

So, my second idea that could leads to goal is:
One "normal" shader for one effect. In this case, I'd render scene several times with corresponding shaders.
However, in this case I'd render scene too many times, wouldn't I?

Suppose that I want to render scene that contains transparent and opaque objects with per-pixel lighting(normal mapping), diffuse texture and ambient occlusion.

So render would be something like:
1) render opaque objects with diffuse texture
2) same with transparent objects
3) normal mapping
4) ambient occlusion

So I'd render scene four times. It's too many because there could be more effects, isn't it?


How to manage this?


I'd be very very thankful for your advices.

Thank you!
Report
Re: How to manage effects? Posted by bondbrayan on 25 Jan 2012 at 10:16 AM
Three-dimensional graphic art, the object is laid at the scene, and rendering. Also taking into account the rest of the scene, and over time its motion and deformation, the location of objects and relationships and size.
Report
Re: How to manage effects? Posted by bondbrayan on 25 Jan 2012 at 10:18 AM
Three-dimensional graphic art, the object is laid at the scene, and rendering. Also taking into account the rest of the scene, and over time its motion and deformation, the location of objects and relationships and size.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.