1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Corrects composition colour phase.

This commit is contained in:
Thomas Harte 2020-08-20 20:45:45 -04:00
parent 4e21d24b5f
commit 7c23c32e44

View File

@ -174,7 +174,11 @@ vertex SourceInterpolator scanToComposition( constant Uniforms &uniforms [[buffe
result.position.zw = float2(0.0, 1.0); result.position.zw = float2(0.0, 1.0);
result.textureCoordinates.x = mix(scans[instanceID].endPoints[0].dataOffset, scans[instanceID].endPoints[1].dataOffset, float(vertexID)); result.textureCoordinates.x = mix(scans[instanceID].endPoints[0].dataOffset, scans[instanceID].endPoints[1].dataOffset, float(vertexID));
result.textureCoordinates.y = scans[instanceID].dataY; result.textureCoordinates.y = scans[instanceID].dataY;
result.colourPhase = mix(scans[instanceID].endPoints[0].compositeAngle, scans[instanceID].endPoints[1].compositeAngle, float(vertexID)) / 32.0f; result.colourPhase = 3.141592654f * mix(
float(scans[instanceID].endPoints[0].compositeAngle),
float(scans[instanceID].endPoints[1].compositeAngle),
float(vertexID)
) / 32.0;
result.colourAmplitude = float(scans[instanceID].compositeAmplitude) / 255.0f; result.colourAmplitude = float(scans[instanceID].compositeAmplitude) / 255.0f;
// Map position into eye space, allowing for target texture dimensions. // Map position into eye space, allowing for target texture dimensions.