Hi.
I decided to go the uniform way as it fits EffectCompositor easily.
Source code of applying materials to nodes: http://goo.gl/PmJaif
Pipeline XML: http://goo.gl/KCU7Qt
Materials XML: http://goo.gl/BtV7Gt
Result: http://youtu.be/Jjk0mlmoB2c
This seems like a fine way to specify object material
Am 07.11.2013 14:04, schrieb michael kapelko:
I was thinking of creating some sort of material.xml and assign it to
each object (or a group of objects).
You could totally do this. So material.xml could contain the defines.
As far as I understand, the define approach creates one shader per
objec
I was thinking of creating some sort of material.xml and assign it to each
object (or a group of objects).
As far as I understand, the define approach creates one shader per object
eventually. And that turns out to be faster than one shader per pipeline
with different StateSets and uniforms per obj
As this is company code and part of a bigger framework I can only give
you some hints.
I have a custom shader loader which parses the shader source in order to
later add the defines and creates a osg::Program derived class
e.g. CustomProgram.
In GLSL you can use preprocessor macros like in C.
Can you please provide an example of how an object manages its define-set?
In my case, I simply get the object's StateSet and setup uniforms. But I
don't get how to setup defines.
Thanks.
2013/11/7 Sebastian Messerschmidt
> Am 07.11.2013 12:55, schrieb michael kapelko:
>
> Hi, Sebastian.
>
>
Am 07.11.2013 12:55, schrieb michael kapelko:
Hi, Sebastian.
So you compose one shader per object?
No, one program per define-set (e.g. #define NORMAL_MAPPING,#define
PARALLAX_MAPPING, ...)
The idea is not to compose the shader from functional blocks, but to
write one shader containing all pat
Hi, Sebastian.
So you compose one shader per object?
Thanks.
2013/11/7 Sebastian Messerschmidt
> Hi Michael,
>
> I solved a similar problem by overriding osg::Program which composes a
> shader from an Ubershader. This is not done via uniforms but defines.
> It seems to work somehow and impro
Hi Michael,
I solved a similar problem by overriding osg::Program which composes a
shader from an Ubershader. This is not done via uniforms but defines.
It seems to work somehow and improved the performance over branching
based on uniforms.
Hi.
I decided to go with single pipeline that pro
Hi.
I decided to go with single pipeline that provides big shaders and objects
using own uniforms and textures to change the pipeline behaviour.
I started to design a simple material format so that it resembles the one
of EffectCompositor.
Thanks.
2013/10/31 michael kapelko
> Hi, Wang.
>
> I'
Hi, Wang.
I've just checked if I can use some uber shader and control its behaviour
per object by setting the object's uniforms. And it works.
I wonder if that's ok to do that to make different objects rendered
differently in the same scene.
Thanks.
2013/10/31 Wang Rui
> Hi Michael,
>
> Effect
Hi Michael,
Effect compositor in fact adds the child scene graph to a camera binding to
a FBO, and then uses RTT cameras to perform the post processing work. The
last step is always to show the final image on an HUD quad so all other
scene nodes will be occluded. The only way to make the effect co
Hi.
I've recently implemented deferred shading with normal mapping and shadow
mapping using EffectCompositor, but it has effect on the whole scene, not a
single object.
Is it possible to use EffectCompositor to apply effects per object?
Thanks.
___
osg-us
12 matches
Mail list logo