#Why does my Hdr Color Change Not Happen from Black when using prototype_lyon

8 messages · Page 1 of 1 (latest)

bronze crown
#

I have a situation where I would like to create a line in a Bevy application where I need it to be selectable while not physically showing up on the screen, but then when clicked it's color changes to something that is visible. I attempted to make the line invisible by setting the color to black with Color::srgb(0.0, 0.0, 0.0) and then in a system change its color to something like Color::srgb(5.0, 0.0, 2.0). When I do this, there is no observable effect. I do get an observable effect if I set the initial color to something other than black. And interestingly enough, the magnitude of the effect is dependent on how "bright" I make the initial color.

To hilight this situation, I have taken the Bloom 2D example and added the overall effect. I have set the initial color for the box and the polygon to be black and white, resepctively. I then added three lines using prototype_lyon in the middle with initial colors of black, white, and Hdr white. Then when you hit the "L" key, you will see that the colors for the square and polygon (built using standard Bevy objects) change to red as desired, and the prototype_lyon lines change to very birght blue for the hdr white, muted blue for the white, and no visibility for the one with initial black. Please see the attached images for graphical examples of this. (Was not sure how to include them in the post in-line)

I have included the code to make the images in the following Gist for easy reference.
https://gist.github.com/justacec/0d8d093d6bf1ebd088050d59ab000d61

Thanks for any and all assistance or suggestions on this.

Gist

Example where lines created with prototype_lyon do not accept new colors with Bloom in Bevy - cargo.toml

prisma hound
bronze crown
#

I will take a look at that. But... When I run the actual application which has the egui diagnostics tool to inspect the tree live, I do not see a whole lot of hierarchy to represent lyon internals. But that could be because the egui diagnositcs tools might not be able to see into that. I will check when I get home tonight

#

But based on that, it seems that Replacing the MeshMaterial2D instance in the entity would cover it.

bronze crown
#

Ahhh! Thank you for pointing me in the right direction.

#

To make this work I needed to adjust the fill and stroke properties of the Shape component.

#

I am quite a bit still confused by the role of the MeshMaterial2D component now though. But I will go ahead and mark this question as solved.