gazebosim / gazebosim/gz-rendering

Setting particle emitter color range makes particles black

Open
#902 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
81
Forks
90
Avg merge
1d 13h
Merged PRs (30d)
10

Description

## 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](https://github.com/gazebosim/gz-rendering/blob/6fa1fc184d052b5235fa7ad7b75c9682142df39f/ogre2/src/Ogre2ParticleEmitter.cc#L295) 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](https://github.com/gazebosim/gz-rendering/blob/gz-rendering7/ogre2/src/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](https://github.com/gazebosim/gz-rendering/blob/6fa1fc184d052b5235fa7ad7b75c9682142df39f/examples/particles_demo/Main.cc#L132) from"

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

to

```cpp
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](https://github.com/gazebosim/gz-rendering/assets/4000684/fc518562-bc52-47ed-acc9-e4dc7f158f36)

Contributor guide

Open the contributing guide

Research direction

Start with Ogre2ParticleEmitter::SetColorRange in ogre2/src/Ogre2ParticleEmitter.cc and the reproduction change in examples/particles_demo/Main.cc. Compare the working ign-rendering6 behavior with gz-rendering7 and the Ogre 2.2 versus 2.3 particle-system code. Done means the particle demo renders the configured color range from red to green instead of black.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.