Skip to content

Commit 1682dbb

Browse files
committed
1 parent db194df commit 1682dbb

File tree

5 files changed

+42
-19
lines changed

5 files changed

+42
-19
lines changed

release/RedGL.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8781,10 +8781,11 @@ var RedPBRMaterial_System;
87818781
//#REDGL_DEFINE#roughnessTexture# tRoughnessPower *= roughnessColor.g; // 거칠기 산출 roughnessColor.g
87828782

87838783
// diffuse 색상 산출
8784-
texelColor = u_useVertexColor_0 ? vVertexColor_0 * uBaseColorFactor : uBaseColorFactor;
8784+
texelColor = u_useVertexColor_0 ? clamp(vVertexColor_0,0.0,1.0) * uBaseColorFactor : uBaseColorFactor;
87858785
//#REDGL_DEFINE#diffuseTexture# texelColor *= texture2D(u_diffuseTexture, u_diffuseTexCoord);
87868786
//#REDGL_DEFINE#diffuseTexture# texelColor.rgb *= texelColor.a;
87878787

8788+
87888789
// 노멀값 계산
87898790
N = normalize(vVertexNormal);
87908791
//#REDGL_DEFINE#useMaterialDoubleSide# vec3 fdx = dFdx(vVertexPosition.xyz);
@@ -13031,18 +13032,18 @@ var RedGLTFLoader;
1303113032
// console.log('tAlphaCutoff', tAlphaCutoff)
1303213033
switch (tAlphaMode) {
1303313034
// TODO
13034-
case 'OPAQUE' :
13035-
tMesh.useBlendMode = false
13036-
break
13035+
1303713036
case 'BLEND' :
1303813037
tMesh['useTransparentSort'] = true
1303913038
break
1304013039
case 'MASK' :
13040+
tMesh.useBlendMode = false
1304113041
tMesh['useTransparentSort'] = true
1304213042
tMaterial.cutOff = tAlphaCutoff
1304313043
break
1304413044
default :
1304513045
tMesh.useBlendMode = false
13046+
tMaterial._cutOff = -0.1
1304613047
// tMesh.useBlendMode = false
1304713048
}
1304813049
if (verticesColor_0.length) tMaterial.useVertexColor_0 = true
@@ -23546,4 +23547,4 @@ var RedGLOffScreen;
2354623547
}
2354723548
RedWorkerCode = RedWorkerCode.toString().replace(/^function ?. ?\) ?\{|\}\;?$/g, '');
2354823549
})();
23549-
})();var RedGL_VERSION = {version : 'RedGL Release. last update( 2019-01-21 22:12:10)' };console.log(RedGL_VERSION);
23550+
})();var RedGL_VERSION = {version : 'RedGL Release. last update( 2019-01-26 20:12:37)' };console.log(RedGL_VERSION);

release/RedGL.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rnd/gltfInterpolation_cubic/RedGLTFLoader_InterpolationTest.html

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,25 @@
6868
// assetPath + 'cubemap/SwedishRoyalCastle/pz.jpg',
6969
// assetPath + 'cubemap/SwedishRoyalCastle/nz.jpg'
7070
// ])
71-
// RedGLTFLoader(this, 'https://rawcdn.githack.com/BabylonJS/Exporters/9bc140006be149687be045f60b4a25cdb45ce4fc/Maya/Samples/glTF 2.0/T-Rex/', 'trex_running.gltf', function (v) {
72-
// tScene.addChild(v['resultMesh'])
73-
// })
71+
RedGLTFLoader(this, 'https://cdn.rawgit.com/ft-lab/ft-lab.github.io/c56ef016/gltf/grass/', 'rocks_trees_ao.glb', function (v) {
72+
tScene.addChild(v['resultMesh'])
73+
v['resultMesh'].x = -2
74+
})
75+
RedGLTFLoader(this, 'https://cdn.rawgit.com/mrdoob/three.js/dev/examples/models/gltf/', 'PrimaryIonDrive.glb', function (v) {
76+
tScene.addChild(v['resultMesh'])
77+
v['resultMesh'].x = 2
78+
})
79+
RedGLTFLoader(this, assetPath + 'glTF/basic/', 'VertexColorTest.gltf', function (v) {
80+
tScene.addChild(v['resultMesh'])
81+
v['resultMesh'].z = -4
82+
v['resultMesh'].x = -2
83+
})
84+
RedGLTFLoader(this, 'https://cx20.github.io/gltf-test/sampleModels/BoxVertexColors/glTF-Binary/', 'BoxVertexColors.glb', function (v) {
7485

86+
tScene.addChild(v['resultMesh'])
87+
v['resultMesh'].z = -4
88+
v['resultMesh'].x = 2
89+
})
7590
// RedGLTFLoader(this, 'https://cdn.rawgit.com/mrdoob/rome-gltf/784089b4/files/models/life_soup/', 'quadruped_fox.gltf', function (v) {
7691
// tScene.addChild(v['resultMesh'])
7792
// })
@@ -88,13 +103,19 @@
88103
// v['resultMesh'].z = 2
89104
// })
90105
//
91-
//
92-
RedGLTFLoader(this, assetPath + 'glTF/basic/', 'TextureSettingsTest.gltf', function (v) {
93-
console.log('호잇!', v)
106+
RedGLTFLoader(this, 'https://rawcdn.githack.com/BabylonJS/Exporters/9bc140006be149687be045f60b4a25cdb45ce4fc/Maya/Samples/glTF 2.0/T-Rex/', 'trex_running.gltf', function (v) {
94107
tScene.addChild(v['resultMesh'])
95108

96-
// v['resultMesh'].x = 5
109+
v['resultMesh'].scaleX = v['resultMesh'].scaleY = v['resultMesh'].scaleZ = 0.001
110+
v['resultMesh'].x = -1
97111
})
112+
//
113+
// RedGLTFLoader(this, assetPath + 'glTF/basic/', 'TextureSettingsTest.gltf', function (v) {
114+
// console.log('호잇!', v)
115+
// tScene.addChild(v['resultMesh'])
116+
//
117+
// // v['resultMesh'].x = 5
118+
// })
98119
} else {
99120
console.log('초기화 실패!')
100121
}

src/loader/gltf/RedGLTFLoader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,18 +1646,18 @@ var RedGLTFLoader;
16461646
// console.log('tAlphaCutoff', tAlphaCutoff)
16471647
switch (tAlphaMode) {
16481648
// TODO
1649-
case 'OPAQUE' :
1650-
tMesh.useBlendMode = false
1651-
break
1649+
16521650
case 'BLEND' :
16531651
tMesh['useTransparentSort'] = true
16541652
break
16551653
case 'MASK' :
1654+
tMesh.useBlendMode = false
16561655
tMesh['useTransparentSort'] = true
16571656
tMaterial.cutOff = tAlphaCutoff
16581657
break
16591658
default :
16601659
tMesh.useBlendMode = false
1660+
tMaterial._cutOff = -0.1
16611661
// tMesh.useBlendMode = false
16621662
}
16631663
if (verticesColor_0.length) tMaterial.useVertexColor_0 = true

src/material/system/RedPBRMaterial_System.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ var RedPBRMaterial_System;
136136
//#REDGL_DEFINE#roughnessTexture# tRoughnessPower *= roughnessColor.g; // 거칠기 산출 roughnessColor.g
137137
138138
// diffuse 색상 산출
139-
texelColor = u_useVertexColor_0 ? vVertexColor_0 * uBaseColorFactor : uBaseColorFactor;
139+
texelColor = u_useVertexColor_0 ? clamp(vVertexColor_0,0.0,1.0) * uBaseColorFactor : uBaseColorFactor;
140140
//#REDGL_DEFINE#diffuseTexture# texelColor *= texture2D(u_diffuseTexture, u_diffuseTexCoord);
141141
//#REDGL_DEFINE#diffuseTexture# texelColor.rgb *= texelColor.a;
142142
143+
143144
// 노멀값 계산
144145
N = normalize(vVertexNormal);
145146
//#REDGL_DEFINE#useMaterialDoubleSide# vec3 fdx = dFdx(vVertexPosition.xyz);

0 commit comments

Comments
 (0)