In CustomShader , normalized values are wrong when the componentType is "UINT8".
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
I have a points cloud tileset which has a property named "velocity".
I normalized it and I set the property normalized to true.

But In CustomShader, I got the wrong values.
It seems that the normalized data is not divided by 255.0 before Cesium return result to user;
I got the velocity which was not between min and max;

I tested the velocity value;
Its value was original * scale + offset;
But it should be original / 255.0 * scale + offset;
[test data: 3dtiles.zip](https://github.com/CesiumGS/cesium/files/10774069/3dtiles.zip)
shader code:
float velocity = fsInput.metadata.velocity;
if(velocity < 25.0)
{
material.diffuse = vec3(1.0, 0.0, 0.0);
material.alpha = 0.9;
}
else
{
material.diffuse = vec3(0.0, 1.0, 0.0);
material.alpha = 0.9;
}
Sandcastle example:
Browser: edge
Operating System: win10
Contributor guide
Research direction
Start by reproducing the issue with the attached 3dtiles.zip and the provided CustomShader snippet, then trace how fsInput.metadata.velocity is handled for normalized UINT8 properties. Done means the value is divided by 255.0 before scale and offset are applied, matching the expected normalized range.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100