mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-16 21:39:29 -07:00
Fixed a math issue in the symbol UV function.
This commit is contained in:
1
TODO.txt
1
TODO.txt
@@ -2,7 +2,6 @@ TODO:
|
||||
|
||||
WebGPU
|
||||
First decent rainRender
|
||||
What's wrong with the other font textures?
|
||||
Port compute pass 100%
|
||||
Compute entry point can live in the same wgsl file, I think
|
||||
use textureLoad for texel access in render pipeline
|
||||
|
||||
@@ -25,7 +25,7 @@ float median3(vec3 i) {
|
||||
vec2 getSymbolUV(float glyphCycle) {
|
||||
float symbol = floor(glyphSequenceLength * glyphCycle);
|
||||
float symbolX = mod(symbol, glyphTextureColumns);
|
||||
float symbolY = ((glyphTextureColumns - 1.0) - (symbol - symbolX) / glyphTextureColumns);
|
||||
float symbolY = glyphTextureColumns - floor(symbol / glyphTextureColumns);
|
||||
return vec2(symbolX, symbolY);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ fn wobble(x:f32) -> f32 {
|
||||
var uv = (quadPosition + quadCorner) / quadGridSize;
|
||||
|
||||
// Retrieve the quad's glyph data
|
||||
var vGlyph = vec4<f32>(1.0, 0.72, randomFloat(vec2<f32>(quadPosition.x, 1.0)), 0.0); // TODO: texture2D(state, quadPosition / quadGridSize);
|
||||
var vGlyph = vec4<f32>(1.0, 0.0, randomFloat(vec2<f32>(quadPosition.x, 1.0)), 0.0); // TODO: texture2D(state, quadPosition / quadGridSize);
|
||||
|
||||
// Calculate the quad's depth
|
||||
var quadDepth = 0.0;
|
||||
@@ -181,7 +181,7 @@ fn median3(i:vec3<f32>) -> f32 {
|
||||
fn getSymbolUV(glyphCycle:f32) -> vec2<f32> {
|
||||
var symbol = i32(f32(msdf.glyphSequenceLength) * glyphCycle);
|
||||
var symbolX = symbol % msdf.glyphTextureColumns;
|
||||
var symbolY = ((msdf.glyphTextureColumns - 1) - (symbol - symbolX) / msdf.glyphTextureColumns);
|
||||
var symbolY = symbol / msdf.glyphTextureColumns;
|
||||
return vec2<f32>(f32(symbolX), f32(symbolY));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user