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

Commit

Permalink
Release 0.10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
elfrank committed Oct 5, 2020
1 parent ea68d04 commit 28ecded
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
31 changes: 19 additions & 12 deletions build/RayTracingRenderer.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,19 @@
uniforms[name] = uniform;
}

var failedUnis = new Set();

function setUniform(name, v0, v1, v2, v3) {
// v0 - v4 are the values to be passed to the uniform
// v0 can either be a number or an array, and v1-v3 are optional
var uni = uniforms[name];

if (!uni) {
// if (!failedUnis.has(name)) {
// console.warn(`Uniform "${name}" does not exist in shader`);
// failedUnis.add(name);
// }
if (!failedUnis.has(name)) {
console.warn("Uniform \"".concat(name, "\" does not exist in shader"));
failedUnis.add(name);
}

return;
}

Expand Down Expand Up @@ -692,8 +695,7 @@
}

function makeRenderPass(gl, params) {
var defines = params.defines,
fragment = params.fragment,
var fragment = params.fragment,
vertex = params.vertex;
var vertexCompiled = vertex instanceof WebGLShader ? vertex : makeVertexShader(gl, params);
var fragmentCompiled = fragment instanceof WebGLShader ? fragment : makeFragmentShader(gl, params);
Expand Down Expand Up @@ -1212,6 +1214,16 @@
};
}

function getFormat(gl, channels) {
var map = {
1: gl.RED,
2: gl.RG,
3: gl.RGB,
4: gl.RGBA
};
return map[channels];
}

function getTextureFormat(gl, channels, storage, data, gammaCorrection) {
var type;
var internalFormat;
Expand Down Expand Up @@ -1252,12 +1264,7 @@
type = gl.UNSIGNED_BYTE;
}

var format = {
1: gl.RED,
2: gl.RG,
3: gl.RGB,
4: gl.RGBA
}[channels];
var format = getFormat(gl, channels);
return {
format: format,
internalFormat: internalFormat,
Expand Down
28 changes: 17 additions & 11 deletions build/RayTracingRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,18 @@
uniforms[name] = uniform;
}

const failedUnis = new Set();

function setUniform(name, v0, v1, v2, v3) {
// v0 - v4 are the values to be passed to the uniform
// v0 can either be a number or an array, and v1-v3 are optional
const uni = uniforms[name];

if (!uni) {
// if (!failedUnis.has(name)) {
// console.warn(`Uniform "${name}" does not exist in shader`);
// failedUnis.add(name);
// }
if (!failedUnis.has(name)) {
console.warn(`Uniform "${name}" does not exist in shader`);
failedUnis.add(name);
}

return;
}
Expand Down Expand Up @@ -359,7 +361,6 @@

function makeRenderPass(gl, params) {
const {
defines,
fragment,
vertex,
} = params;
Expand Down Expand Up @@ -1057,6 +1058,16 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
};
}

function getFormat(gl, channels) {
const map = {
1: gl.RED,
2: gl.RG,
3: gl.RGB,
4: gl.RGBA
};
return map[channels];
}

function getTextureFormat(gl, channels, storage, data, gammaCorrection) {
let type;
let internalFormat;
Expand Down Expand Up @@ -1107,12 +1118,7 @@ vec3 getMatNormal(int materialIndex, vec2 uv, vec3 normal, vec3 dp1, vec3 dp2, v
type = gl.UNSIGNED_BYTE;
}

const format = {
1: gl.RED,
2: gl.RG,
3: gl.RGB,
4: gl.RGBA
}[channels];
const format = getFormat(gl, channels);

return {
format,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ray-tracing-renderer",
"version": "0.10.14",
"version": "0.10.15",
"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.",
"main": "build/RayTracingRenderer.js",
"scripts": {
Expand Down

0 comments on commit 28ecded

Please sign in to comment.