Open GoogleCodeExporter opened 9 years ago
Hi,
Have you tried the version in the trunk?
I added MRT support for the glare effect which should allow you to use alpha
textures
at the same time as the glare effect.
Kim.
Original comment by kcb...@googlemail.com
on 27 Jan 2010 at 9:19
Hi KIm,
I downloaded the trunk release...(192)...but having trouble compiling it....
does it
compile against OSG 2.8.2? i'm going to try again....
Maxim
Original comment by maxims...@gmail.com
on 27 Jan 2010 at 7:41
NM...looks like CMake wasn't setting some libs up correctly....
Original comment by maxims...@gmail.com
on 27 Jan 2010 at 8:59
Ok, compiled it... placed it in Delta3D, but i still see the particle
problem....no
change using the 192 trunk version. Accept for a crash i get on the
release....debug
runs though....
Original comment by maxims...@gmail.com
on 27 Jan 2010 at 9:29
fixed the crash..... but the transparency problem still persists....
Original comment by maxims...@gmail.com
on 27 Jan 2010 at 9:55
Ah yes, I think I know the problem.
You need to apply a shader to the particle system which sets the luminance
value in
the glare framebuffer target to zero. See the default shader for this:
i.e. here we set the luminance value in the 2nd FBO to zero so that the glare
pass
ignores it.
if(osgOcean_EnableGlare){
gl_FragData[1] = vec4(0.0);
}
You can use the default shader as your base but you will need to remove things
like
lighting etc so that your particle system blends correctly.
Let me know how you get on,
Kim.
Original comment by kcb...@googlemail.com
on 27 Jan 2010 at 10:30
Thanks Kim,
I will have to try it... I haven't touched shaders yet...but i plan to get to
them
eventually..... when i do i'll let u know if i found a fix for this....
Original comment by maxims...@gmail.com
on 2 Feb 2010 at 10:58
Maximster,
Do you ever get this to work? I'm having the same problem. Kim, when you
mention the
bit about the shaders, where do you set that up? In the shader file or in your
code?
Original comment by dpwi...@gmail.com
on 14 May 2010 at 7:56
Hi Dp?
You'll need to attach a shader which writes to the luminance buffer then make
sure
your your particle system is a child of OceanScene.
When osgOcean render objects with the glare pass enabled it renders to two
framebuffers. The first is the color buffer, the second is the luminance
buffer. If
the value written to the luminance buffer is greater than the glare threshold
it'll
get picked up by the glare pass and will appear to twinkle.
If you do not want your object to appear in the glare pass you have to make
sure that
the value written to the luminance buffer is 0. So you'll need to attach a very
simple shader to the particle system, something like this:
void main(void){
gl_TexCoord[0].st = gl_MultiTexCoord0.st;
gl_Position = ftransform();
}
uniform sampler2D pTexture;
void main(void){
gl_FragData[0] = texture2D( pTexture, gl_TexCoord[0].st );
if(osgOcean_EnableGlare){
// writing zero to the luminance buffer
// this object will get ignored.
gl_FragData[1] = vec4(0.0);
}
}
Let me know how you get on.
Kim.
Original comment by kcb...@googlemail.com
on 15 May 2010 at 8:59
Kim,
Thanks for the quick response. Only question I have is how do I attach a
shader just to the particle system? I'm creating my
particle system in code and attaching it to a delta 3D object:
mProp = dynamic_cast<dtCore::Object*>((*iter)->GetActor());
propBubbles = new dtCore::ParticleSystem;
propBubbles->LoadFile("/effects/cavitation4.osg");
propBubbles->SetTransform(dtCore::Transform(0,2,-0,180,-90,0));
mProp->AddChild(propBubbles.get());
What is the method for attaching a shader to a particle system? I assume I'd
add it, right after creating it in code, yes?
Thanks for your help!
Danny
Original comment by dpwi...@gmail.com
on 17 May 2010 at 3:38
Hi Danny,
I'm afraid I've never used Delta3D. However, in OSG a particle system has a
state which
you can attach a shader to.
Regards,
Kim.
Original comment by kcb...@googlemail.com
on 18 May 2010 at 8:04
In delta 3d, you can grab the actual OSG node, and do all your changes to it
directly... usually its GetOSGNode()->
Original comment by maxims...@gmail.com
on 4 Jun 2010 at 5:00
Maximster,
did you get this to work in Delta3D?
Original comment by dpwi...@gmail.com
on 4 Jun 2010 at 6:08
Hey dpwilli,
No, we never got the time to look into this, and then my client changed his mind
about the particles all together and went with solid geometry....
Eventually im still planign to look into it or build my own ocean on top of
osgOcean,
because it looks like dtOcean is not updated as fast as osgOcean is...its
missing new
options... and i think it introduces a glare bug to the skydome
Original comment by maxims...@gmail.com
on 7 Jun 2010 at 3:56
Original issue reported on code.google.com by
maxims...@gmail.com
on 27 Jan 2010 at 1:41Attachments: