Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit 28ecded

Browse files
committed
Release 0.10.15
1 parent ea68d04 commit 28ecded

File tree

4 files changed

+38
-25
lines changed

4 files changed

+38
-25
lines changed

build/RayTracingRenderer.es5.js

+19-12
Original file line numberDiff line numberDiff line change
@@ -618,16 +618,19 @@
618618
uniforms[name] = uniform;
619619
}
620620

621+
var failedUnis = new Set();
622+
621623
function setUniform(name, v0, v1, v2, v3) {
622624
// v0 - v4 are the values to be passed to the uniform
623625
// v0 can either be a number or an array, and v1-v3 are optional
624626
var uni = uniforms[name];
625627

626628
if (!uni) {
627-
// if (!failedUnis.has(name)) {
628-
// console.warn(`Uniform "${name}" does not exist in shader`);
629-
// failedUnis.add(name);
630-
// }
629+
if (!failedUnis.has(name)) {
630+
console.warn("Uniform \"".concat(name, "\" does not exist in shader"));
631+
failedUnis.add(name);
632+
}
633+
631634
return;
632635
}
633636

@@ -692,8 +695,7 @@
692695
}
693696

694697
function makeRenderPass(gl, params) {
695-
var defines = params.defines,
696-
fragment = params.fragment,
698+
var fragment = params.fragment,
697699
vertex = params.vertex;
698700
var vertexCompiled = vertex instanceof WebGLShader ? vertex : makeVertexShader(gl, params);
699701
var fragmentCompiled = fragment instanceof WebGLShader ? fragment : makeFragmentShader(gl, params);
@@ -1212,6 +1214,16 @@
12121214
};
12131215
}
12141216

1217+
function getFormat(gl, channels) {
1218+
var map = {
1219+
1: gl.RED,
1220+
2: gl.RG,
1221+
3: gl.RGB,
1222+
4: gl.RGBA
1223+
};
1224+
return map[channels];
1225+
}
1226+
12151227
function getTextureFormat(gl, channels, storage, data, gammaCorrection) {
12161228
var type;
12171229
var internalFormat;
@@ -1252,12 +1264,7 @@
12521264
type = gl.UNSIGNED_BYTE;
12531265
}
12541266

1255-
var format = {
1256-
1: gl.RED,
1257-
2: gl.RG,
1258-
3: gl.RGB,
1259-
4: gl.RGBA
1260-
}[channels];
1267+
var format = getFormat(gl, channels);
12611268
return {
12621269
format: format,
12631270
internalFormat: internalFormat,

build/RayTracingRenderer.js

+17-11
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,18 @@
275275
uniforms[name] = uniform;
276276
}
277277

278+
const failedUnis = new Set();
279+
278280
function setUniform(name, v0, v1, v2, v3) {
279281
// v0 - v4 are the values to be passed to the uniform
280282
// v0 can either be a number or an array, and v1-v3 are optional
281283
const uni = uniforms[name];
282284

283285
if (!uni) {
284-
// if (!failedUnis.has(name)) {
285-
// console.warn(`Uniform "${name}" does not exist in shader`);
286-
// failedUnis.add(name);
287-
// }
286+
if (!failedUnis.has(name)) {
287+
console.warn(`Uniform "${name}" does not exist in shader`);
288+
failedUnis.add(name);
289+
}
288290

289291
return;
290292
}
@@ -359,7 +361,6 @@
359361

360362
function makeRenderPass(gl, params) {
361363
const {
362-
defines,
363364
fragment,
364365
vertex,
365366
} = params;
@@ -1057,6 +1058,16 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
10571058
};
10581059
}
10591060

1061+
function getFormat(gl, channels) {
1062+
const map = {
1063+
1: gl.RED,
1064+
2: gl.RG,
1065+
3: gl.RGB,
1066+
4: gl.RGBA
1067+
};
1068+
return map[channels];
1069+
}
1070+
10601071
function getTextureFormat(gl, channels, storage, data, gammaCorrection) {
10611072
let type;
10621073
let internalFormat;
@@ -1107,12 +1118,7 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
11071118
type = gl.UNSIGNED_BYTE;
11081119
}
11091120

1110-
const format = {
1111-
1: gl.RED,
1112-
2: gl.RG,
1113-
3: gl.RGB,
1114-
4: gl.RGBA
1115-
}[channels];
1121+
const format = getFormat(gl, channels);
11161122

11171123
return {
11181124
format,

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ray-tracing-renderer",
3-
"version": "0.10.14",
3+
"version": "0.10.15",
44
"description": "A [Three.js](https://github.com/mrdoob/three.js/) renderer which utilizes path tracing to render a scene with true photorealism. The renderer supports global illumination, reflections, soft shadows, and realistic environment lighting.",
55
"main": "build/RayTracingRenderer.js",
66
"scripts": {

0 commit comments

Comments
 (0)