Re: [osg-users] Shaders for textures with OpenGL ES 2.0

2015-10-25 Thread Chris Hanson
Well, the FFP material state info doesn't exist in ES 2.0. So, it's getting
skipped.

You need to write a visitor that traverses your model converting OSG
Material class attributes into Uniforms that your shaders then read and
understand and react to.

On Sun, Oct 25, 2015 at 11:12 AM, Şan Güneş  wrote:

> Hello,
>
> I'm playing around with OpenSceneGraph with OpenGL ES 2.0. I managed to
> show some primitives, and later a model that I loaded with osgDB.
> However at the moment I'm assigning a random color to the gl_FragColor
> in the fragment shader. When doing this I'm getting the following warning:
>
> > Warning: Material::apply(State&) - not supported.
>
> I'm confused about how I should write the shaders if I load a model with
> osgDB in order to show it together with it's texture. So far I couldn't
> find any OpenSceneGraph related example for this. I would appreciate any
> help and tips.
>
> Thanks
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] particle speed in OSG Particle Effects

2015-10-25 Thread Trajce Nikolov NICK
Hi Community,

I am trying to work with the sample particle effects, and to change their
speed. I thought it is enough to change the default particle template
velocity, but whatwever I do it seams it has no effect. Here is some
snippet of my approach. Anyone with hint? Thanks a bunch as always

osg::ref_ptr effect;
effect = new osgParticle::SmokeEffect(osg::Vec3(0, 0, 0), scale, intensity);
osgParticle::Particle& particle =
const_cast(effect->getDefaultParticleTemplate());
particle.setVelocity(osg::Vec3(0, 0, particleSpeed));

Nick

-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Shaders for textures with OpenGL ES 2.0

2015-10-25 Thread Şan Güneş
Hello,

I'm playing around with OpenSceneGraph with OpenGL ES 2.0. I managed to
show some primitives, and later a model that I loaded with osgDB.
However at the moment I'm assigning a random color to the gl_FragColor
in the fragment shader. When doing this I'm getting the following warning:

> Warning: Material::apply(State&) - not supported.

I'm confused about how I should write the shaders if I load a model with
osgDB in order to show it together with it's texture. So far I couldn't
find any OpenSceneGraph related example for this. I would appreciate any
help and tips.

Thanks
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] particle speed in OSG Particle Effects

2015-10-25 Thread Jannik Heller
Hi Nick,

the particle template's velocity isn't used, it's the particle emitter that 
determines initial particle velocity. Have a look at the ModularEmitter / 
Shooter classes in osgParticle.

If you wanted to globally make particles simulate faster (as in a time lapse) 
you could just change the osg simulationTime to run faster.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65438#65438





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Issue with texturing label

2015-10-25 Thread sam
Hi All,

I'm struggling with finding out why I have some discrepancy between my
texture and what my osg is drawing. I have setup a label and put a texture
against it as follows:

[image: Inline image 1]

But unfortunately I get that thin white bar at the bottom of the label. It
seems to change color based on what is below it. I have tried to turn off
blending and change the blend function but no luck thus far. Any help would
be greatly appreciated. Here is the original texture image:

[image: Displaying b_gui_cmn_button5_center_up.png]

Thanks, Sam
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] particle speed in OSG Particle Effects

2015-10-25 Thread Trajce Nikolov NICK
Wops, too fast .. Pressed wrong keys

void osgParticle::ModularEmitter::emitParticles(double dt)

Particle* P = getParticleSystem()->createParticle(getUseDefaultTemplate()?
0: ());
if (P)
{
_placer->place(P);
P->setPosition(P->getPosition() * worldToPs);
_shooter->shoot(P);
P->setVelocity(osg::Matrix::transform3x3(P->getVelocity(),
 worldToPs));

if (cps)
P->setUpTexCoordsAsPartOfConnectedParticleSystem(cps);
}

On Sun, Oct 25, 2015 at 7:36 PM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi Jannik,
>
> thanks for the hint. Here is what I see in ModularEmitter:
>
>
> On Sun, Oct 25, 2015 at 7:25 PM, Jannik Heller 
> wrote:
>
>> Hi Nick,
>>
>> the particle template's velocity isn't used, it's the particle emitter
>> that determines initial particle velocity. Have a look at the
>> ModularEmitter / Shooter classes in osgParticle.
>>
>> If you wanted to globally make particles simulate faster (as in a time
>> lapse) you could just change the osg simulationTime to run faster.
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=65438#65438
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] particle speed in OSG Particle Effects

2015-10-25 Thread Trajce Nikolov NICK
Hi Jannik,

thanks for the hint. Here is what I see in ModularEmitter:


On Sun, Oct 25, 2015 at 7:25 PM, Jannik Heller 
wrote:

> Hi Nick,
>
> the particle template's velocity isn't used, it's the particle emitter
> that determines initial particle velocity. Have a look at the
> ModularEmitter / Shooter classes in osgParticle.
>
> If you wanted to globally make particles simulate faster (as in a time
> lapse) you could just change the osg simulationTime to run faster.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65438#65438
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] particle speed in OSG Particle Effects

2015-10-25 Thread Trajce Nikolov NICK
Jannik, you were right .. Here is the thing (bellow) .. Thanks a bunch for
the pointer !!

inline void RadialShooter::shoot(Particle* P) const
{
float theta = _theta_range.get_random();
float phi = _phi_range.get_random();
float speed = _speed_range.get_random();
osg::Vec3 rot_speed = _rot_speed_range.get_random();

P->setVelocity(osg::Vec3(
speed * sinf(theta) * cosf(phi),
speed * sinf(theta) * sinf(phi),
speed * cosf(theta)
));

P->setAngularVelocity(rot_speed);
}

On Sun, Oct 25, 2015 at 7:37 PM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Wops, too fast .. Pressed wrong keys
>
> void osgParticle::ModularEmitter::emitParticles(double dt)
> 
> Particle* P = getParticleSystem()->createParticle(getUseDefaultTemplate()?
> 0: ());
> if (P)
> {
> _placer->place(P);
> P->setPosition(P->getPosition() * worldToPs);
> _shooter->shoot(P);
> P->setVelocity(osg::Matrix::transform3x3(P->getVelocity(),
>  worldToPs));
>
> if (cps)
> P->setUpTexCoordsAsPartOfConnectedParticleSystem(cps);
> }
>
> On Sun, Oct 25, 2015 at 7:36 PM, Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com> wrote:
>
>> Hi Jannik,
>>
>> thanks for the hint. Here is what I see in ModularEmitter:
>>
>>
>> On Sun, Oct 25, 2015 at 7:25 PM, Jannik Heller 
>> wrote:
>>
>>> Hi Nick,
>>>
>>> the particle template's velocity isn't used, it's the particle emitter
>>> that determines initial particle velocity. Have a look at the
>>> ModularEmitter / Shooter classes in osgParticle.
>>>
>>> If you wanted to globally make particles simulate faster (as in a time
>>> lapse) you could just change the osg simulationTime to run faster.
>>>
>>> --
>>> Read this topic online here:
>>> http://forum.openscenegraph.org/viewtopic.php?p=65438#65438
>>>
>>>
>>>
>>>
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>
>>
>>
>> --
>> trajce nikolov nick
>>
>
>
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org