Skip to content
Permalink
Browse files

feat(skybox): fix "left and right reverse" bug

solution
change webgl1_skybox_fragment.glsl->v_texCoord.x to -v_texCoord.x

(update wonder-webgl version)
  • Loading branch information...
yyc-git committed May 26, 2019
1 parent 8818438 commit 59ab763bb090cc7c15aba87d750ee526fbfde490
@@ -75,11 +75,11 @@
"wonder-imgui": "^0.0.34",
"wonder-log": "^0.2.11",
"wonder-most-animation-frame": "0.0.3",
"wonder-webgl": "^0.0.10"
"wonder-webgl": "^0.0.11"
},
"resolutions": {
"wonder-log": "^0.2.11",
"wonder-webgl": "^0.0.10",
"wonder-webgl": "^0.0.11",
"wonder-commonlib": "0.2.32",
"wonder-bs-jest": "0.3.0",
"wonder-bs-puppeteer": "^0.1.6"
@@ -60,7 +60,9 @@ varying vec3 v_texCoord;
|},{|
|}),{|
gl_FragColor = textureCube(u_skyboxCubeMapSampler, v_texCoord);
//gl_FragColor = textureCube(u_skyboxCubeMapSampler, v_texCoord);
vec3 dir = vec3(-v_texCoord.x, v_texCoord.y, v_texCoord.z);
gl_FragColor = textureCube(u_skyboxCubeMapSampler, dir);
|}))

|> set("webgl1_outline_origin_vertex", _buildChunk(({|
@@ -4,5 +4,5 @@ varying vec3 v_texCoord;


@body
gl_FragColor = textureCube(u_skyboxCubeMapSampler, v_texCoord);
gl_FragColor = textureCube(u_skyboxCubeMapSampler, vec3(-v_texCoord.x, v_texCoord.y, v_texCoord.z));
@end
@@ -10,7 +10,7 @@ let drawElement =

let drawArray = (drawMode: int, verticesCount: int, gl) => {
let startOffset = 0;
drawArray(drawMode, startOffset, verticesCount, gl);
drawArrays(drawMode, startOffset, verticesCount, gl);
();
};

0 comments on commit 59ab763

Please sign in to comment.
You can’t perform that action at this time.