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

Commit bd7d558

Browse files
committed
Release 0.9.6
1 parent e5d48e4 commit bd7d558

File tree

3 files changed

+137
-19
lines changed

3 files changed

+137
-19
lines changed

build/RayTracingRenderer.es5.js

Lines changed: 135 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,43 @@
182182
throw new TypeError("Invalid attempt to spread non-iterable instance");
183183
}
184184

185+
function _createSuper(Derived) {
186+
function isNativeReflectConstruct() {
187+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
188+
if (Reflect.construct.sham) return false;
189+
if (typeof Proxy === "function") return true;
190+
191+
try {
192+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
193+
return true;
194+
} catch (e) {
195+
return false;
196+
}
197+
}
198+
199+
return function () {
200+
var Super = _getPrototypeOf(Derived),
201+
result;
202+
203+
if (isNativeReflectConstruct()) {
204+
var NewTarget = _getPrototypeOf(this).constructor;
205+
206+
result = Reflect.construct(Super, arguments, NewTarget);
207+
} else {
208+
result = Super.apply(this, arguments);
209+
}
210+
211+
return _possibleConstructorReturn(this, result);
212+
};
213+
}
185214
var LensCamera =
186215
/*#__PURE__*/
187216
function (_PerspectiveCamera) {
188217
_inherits(LensCamera, _PerspectiveCamera);
189218

190-
function LensCamera() {
191-
var _getPrototypeOf2;
219+
var _super = _createSuper(LensCamera);
192220

221+
function LensCamera() {
193222
var _this;
194223

195224
_classCallCheck(this, LensCamera);
@@ -198,7 +227,7 @@
198227
args[_key] = arguments[_key];
199228
}
200229

201-
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(LensCamera)).call.apply(_getPrototypeOf2, [this].concat(args)));
230+
_this = _super.call.apply(_super, [this].concat(args));
202231
_this.aperture = 0.01;
203232
return _this;
204233
}
@@ -215,19 +244,50 @@
215244
return LensCamera;
216245
}(THREE$1.PerspectiveCamera);
217246

247+
function _createSuper$1(Derived) {
248+
function isNativeReflectConstruct() {
249+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
250+
if (Reflect.construct.sham) return false;
251+
if (typeof Proxy === "function") return true;
252+
253+
try {
254+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
255+
return true;
256+
} catch (e) {
257+
return false;
258+
}
259+
}
260+
261+
return function () {
262+
var Super = _getPrototypeOf(Derived),
263+
result;
264+
265+
if (isNativeReflectConstruct()) {
266+
var NewTarget = _getPrototypeOf(this).constructor;
267+
268+
result = Reflect.construct(Super, arguments, NewTarget);
269+
} else {
270+
result = Super.apply(this, arguments);
271+
}
272+
273+
return _possibleConstructorReturn(this, result);
274+
};
275+
}
218276
var SoftDirectionalLight =
219277
/*#__PURE__*/
220278
function (_DirectionalLight) {
221279
_inherits(SoftDirectionalLight, _DirectionalLight);
222280

281+
var _super = _createSuper$1(SoftDirectionalLight);
282+
223283
function SoftDirectionalLight(color, intensity) {
224284
var _this;
225285

226286
var softness = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
227287

228288
_classCallCheck(this, SoftDirectionalLight);
229289

230-
_this = _possibleConstructorReturn(this, _getPrototypeOf(SoftDirectionalLight).call(this, color, intensity));
290+
_this = _super.call(this, color, intensity);
231291
_this.softness = softness;
232292
return _this;
233293
}
@@ -244,14 +304,43 @@
244304
return SoftDirectionalLight;
245305
}(THREE$1.DirectionalLight);
246306

307+
function _createSuper$2(Derived) {
308+
function isNativeReflectConstruct() {
309+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
310+
if (Reflect.construct.sham) return false;
311+
if (typeof Proxy === "function") return true;
312+
313+
try {
314+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
315+
return true;
316+
} catch (e) {
317+
return false;
318+
}
319+
}
320+
321+
return function () {
322+
var Super = _getPrototypeOf(Derived),
323+
result;
324+
325+
if (isNativeReflectConstruct()) {
326+
var NewTarget = _getPrototypeOf(this).constructor;
327+
328+
result = Reflect.construct(Super, arguments, NewTarget);
329+
} else {
330+
result = Super.apply(this, arguments);
331+
}
332+
333+
return _possibleConstructorReturn(this, result);
334+
};
335+
}
247336
var EnvironmentLight =
248337
/*#__PURE__*/
249338
function (_Light) {
250339
_inherits(EnvironmentLight, _Light);
251340

252-
function EnvironmentLight(map) {
253-
var _getPrototypeOf2;
341+
var _super = _createSuper$2(EnvironmentLight);
254342

343+
function EnvironmentLight(map) {
255344
var _this;
256345

257346
_classCallCheck(this, EnvironmentLight);
@@ -260,7 +349,7 @@
260349
args[_key - 1] = arguments[_key];
261350
}
262351

263-
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(EnvironmentLight)).call.apply(_getPrototypeOf2, [this].concat(args)));
352+
_this = _super.call.apply(_super, [this].concat(args));
264353
_this.map = map;
265354
_this.isEnvironmentLight = true;
266355
return _this;
@@ -278,14 +367,43 @@
278367
return EnvironmentLight;
279368
}(THREE$1.Light);
280369

370+
function _createSuper$3(Derived) {
371+
function isNativeReflectConstruct() {
372+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
373+
if (Reflect.construct.sham) return false;
374+
if (typeof Proxy === "function") return true;
375+
376+
try {
377+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
378+
return true;
379+
} catch (e) {
380+
return false;
381+
}
382+
}
383+
384+
return function () {
385+
var Super = _getPrototypeOf(Derived),
386+
result;
387+
388+
if (isNativeReflectConstruct()) {
389+
var NewTarget = _getPrototypeOf(this).constructor;
390+
391+
result = Reflect.construct(Super, arguments, NewTarget);
392+
} else {
393+
result = Super.apply(this, arguments);
394+
}
395+
396+
return _possibleConstructorReturn(this, result);
397+
};
398+
}
281399
var RayTracingMaterial =
282400
/*#__PURE__*/
283401
function (_MeshStandardMaterial) {
284402
_inherits(RayTracingMaterial, _MeshStandardMaterial);
285403

286-
function RayTracingMaterial() {
287-
var _getPrototypeOf2;
404+
var _super = _createSuper$3(RayTracingMaterial);
288405

406+
function RayTracingMaterial() {
289407
var _this;
290408

291409
_classCallCheck(this, RayTracingMaterial);
@@ -294,7 +412,7 @@
294412
args[_key] = arguments[_key];
295413
}
296414

297-
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RayTracingMaterial)).call.apply(_getPrototypeOf2, [this].concat(args)));
415+
_this = _super.call.apply(_super, [this].concat(args));
298416
_this.solid = false;
299417
_this.shadowCatcher = false;
300418
return _this;
@@ -555,25 +673,25 @@
555673
function upload() {
556674
while (needsUpload.length > 0) {
557675
var _needsUpload$pop = needsUpload.pop(),
558-
type = _needsUpload$pop.type,
559-
location = _needsUpload$pop.location,
676+
_type = _needsUpload$pop.type,
677+
_location = _needsUpload$pop.location,
560678
v0 = _needsUpload$pop.v0,
561679
v1 = _needsUpload$pop.v1,
562680
v2 = _needsUpload$pop.v2,
563681
v3 = _needsUpload$pop.v3;
564682

565-
var glMethod = typeMap[type];
683+
var glMethod = typeMap[_type];
566684

567685
if (v0.length) {
568686
if (glMethod.matrix) {
569687
var array = v0;
570688
var transpose = v1 || false;
571-
gl[glMethod.matrix](location, transpose, array);
689+
gl[glMethod.matrix](_location, transpose, array);
572690
} else {
573-
gl[glMethod.array](location, v0);
691+
gl[glMethod.array](_location, v0);
574692
}
575693
} else {
576-
gl[glMethod.values](location, v0, v1, v2, v3);
694+
gl[glMethod.values](_location, v0, v1, v2, v3);
577695
}
578696
}
579697
}
@@ -610,7 +728,7 @@
610728
var vertexCompiled = vertex instanceof WebGLShader ? vertex : makeVertexShader(gl, params);
611729
var fragmentCompiled = fragment instanceof WebGLShader ? fragment : makeFragmentShader(gl, params);
612730
var program = createProgram(gl, vertexCompiled, fragmentCompiled);
613-
return _objectSpread2({}, makeRenderPassFromProgram(gl, program), {
731+
return _objectSpread2(_objectSpread2({}, makeRenderPassFromProgram(gl, program)), {}, {
614732
outputLocs: fragment.outputs ? getOutputLocations(fragment.outputs) : {}
615733
});
616734
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ray-tracing-renderer",
3-
"version": "0.9.5",
3+
"version": "0.9.6",
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)