mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
889 wip.aa
This commit is contained in:
parent
b7d70d7a0c
commit
b7be4275b2
@ -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,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user