change picking to use floats (#6747)
floats can have up to 16.7M unique integers which is enough for encoding an Entity. This change will help a later one that adds support for ES2
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#if defined(VARIANT_HAS_VSM)
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
#elif defined(VARIANT_HAS_PICKING)
|
||||
layout(location = 0) out highp uint2 outPicking;
|
||||
layout(location = 0) out highp vec2 outPicking;
|
||||
#else
|
||||
// not color output
|
||||
#endif
|
||||
@@ -49,8 +49,8 @@ void main() {
|
||||
fragColor.xy = computeDepthMomentsVSM(depth);
|
||||
fragColor.zw = computeDepthMomentsVSM(-1.0 / depth); // requires at least RGBA16F
|
||||
#elif defined(VARIANT_HAS_PICKING)
|
||||
outPicking.x = uint(object_uniforms.objectId);
|
||||
outPicking.y = floatBitsToUint(vertex_position.z / vertex_position.w);
|
||||
outPicking.x = float(object_uniforms.objectId);
|
||||
outPicking.y = vertex_position.z / vertex_position.w;
|
||||
#else
|
||||
// that's it
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user