scenerygraphics / scenery

Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan.
https://scenery.graphics
GNU Lesser General Public License v3.0
131 stars 32 forks source link

Last node in color map is always black #750

Open moreApi opened 6 months ago

moreApi commented 6 months ago

as seen for example here:

https://github.com/scenerygraphics/scenery/issues/757

java_t13jR7HcXm

odinsbane commented 6 months ago

@moreApi Your example is missing. I seem to be having an issue where textures turn black. If I select a new colormap it will briefly show color, then turn black again. Maybe it is related?

smlpt commented 6 months ago

@odinsbane the volume turning black is likely caused by this bug, for me it happens as soon as I hover over the color map editor.

odinsbane commented 6 months ago

Exactly. That is the issue I am having. I don't know if it is related to this issue.

odinsbane commented 5 months ago

This error is caused by Colormap#sample

val bufferPosition: Float = position.coerceIn(0.0f, 1.0f) * width

Indexes are 0 based so they should go from 0 to width - 1. This is 0 to width, but since the Colormap can have multiple bands it wraps back to the next band... which is black again.