gz-rendering icon indicating copy to clipboard operation
gz-rendering copied to clipboard

Setting particle emitter color range makes particles black

Open iche033 opened this issue 1 year ago • 1 comments

Environment

  • OS Version:
  • Source or binary build? source, garden

Description

  • Expected behavior: Setting color range for particles affect particle color
  • Actual behavior: Particles always appear black

The Ogre2ParticleEmitter::SetColorRange function is working fine in the ign-rendering6 branch which is on ogre2.2. The gz-rendering7 branch is on ogre2.3. Looking at the ogre-next code base, I don't see many changes in the particle system between v2-2 and v2-3 branches. There haven't been any related changes in the Ogre2ParticleEmitter.cc as well. The bug might be coming from other parts of gz-rendering when we upgraded from ogre 2.2 to 2.3.

Steps to reproduce

Modify the particle_demo and change the line from"

areaEmitter->SetColorRangeImage(RESOURCE_PATH + "/smokecolors.png");

to

areaEmitter->SetColorRange(math::Color(1, 0, 0), math::Color(0, 1, 0));

The particles flowing upward from below the duck appear black instead of turning color from red to green

Output

particle_color_affector_bug

iche033 avatar Sep 08 '23 00:09 iche033

There also is a (related?) issue with marker colors, see this post.

I can confirm on Harmonic (source built) with

libogre-next-2.3-dev
Versions: 
2.3.1-9osrf~jammy

that issuing following command spawns white marker:

gz service -s /marker --reqtype gz.msgs.Marker --reptype gz.msgs.Empty --req 'action:ADD_MODIFY, type:SPHERE, id:9, scale: {x: 0.2, y: 0.4, z: 1.2}, pose: {position: {x: 0.0, y: 0.0, z: 0.0},orientation{x:0,y:0,z:0,w:1}},materials:{ambient:{r:1,g:0,b:0,a:1},diffuse:{r:1,g:0,b:0,a:1},specular:{r:1,g:0,b:0,a:1},emissive:{r:1,g:0,b:0,a:1}},visibility:ALL' --timeout 3000

(EDIT: I had initially copy-pasted a wrong command; above is corrected.)

Identical command but Gazebo started with Ogre1 renders in color.

jrutgeer avatar Oct 17 '23 13:10 jrutgeer