889 wip.aa

This commit is contained in:
Michael Gevlich 2025-10-22 15:11:36 +04:00
parent b7d70d7a0c
commit b7be4275b2
3 changed files with 17 additions and 7 deletions

View File

@ -175,8 +175,8 @@ class Ray {
if (img.__nodeIndex != undefined && ta.get(img.__nodeIndex)) {
this._image = img;
let taData = ta.get(img!.__nodeIndex!)!;
let minY = 0,
imgHeight = 0;
let minY = taData.texCoords[1],
imgHeight = taData.texCoords[3] - minY;
bh!.setTexCoordArr(
this._handlerIndex,
taData.texCoords,

View File

@ -807,9 +807,11 @@ class RayHandler {
let ri = this._rays[i];
let img = ri.getImage();
if (img) {
let imageNode = ta.get(img.__nodeIndex!);
if (imageNode) {
this.setTexCoordArr(ri._handlerIndex, imageNode.texCoords);
let taData = ta.get(img.__nodeIndex!);
if (taData) {
let minY = taData.texCoords[1],
imgHeight = taData.texCoords[3] - minY;
this.setTexCoordArr(ri._handlerIndex, taData.texCoords, minY, imgHeight);
}
}
}

View File

@ -7,9 +7,17 @@ varying vec4 v_texCoord;
void main() {
float repeat = 2.0;
vec4 color = texture2D(texAtlas, v_texCoord.xy);
float repeat = 5.0;
vec2 uv = v_texCoord.xy;
float min = v_texCoord.z;
float height = v_texCoord.w;
float localY = fract((uv.y - min) / height * repeat);
uv.y = min + localY * height;
vec4 color = texture2D(texAtlas, uv);
gl_FragColor = v_rgba * color;
}