Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 416c650

Browse files
emptyflashPWhiddy
authored andcommitted
Allow users to pass uniforms and fix screen clearing
1 parent e7a26fb commit 416c650

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

‎dist/shader-park-core.cjs.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.1.38 - January 19, 2023 15:44:27 */
1+
/* Version: 0.1.38 - February 7, 2023 15:08:43 */
22
'use strict';
33

44
Object.defineProperty(exports, '__esModule', { value: true });
@@ -95883,25 +95883,24 @@ function fragToMinimalRenderer(canvas, fullFrag, updateUniforms) {
9588395883
}
9588495884
}
9588595885

95886-
function sculptToHydraRenderer(source) {
95886+
function sculptToHydraRenderer(source, userUniforms) {
9588795887
var frag = sculptToHydraGLSL(source);
9588895888
return {
9588995889
out: function out(output) {
95890-
var uniforms = {
95890+
var uniforms = _objectSpread2({
9589195891
time: output.regl.prop('time'),
9589295892
opacity: 0.5,
9589395893
_scale: 1.0,
9589495894
resolution: output.regl.prop('resolution'),
9589595895
stepSize: 0.85
95896-
}; // By default hydra doesn't clear the framebuffers
95896+
}, userUniforms); // By default hydra doesn't clear the framebuffers
95897+
9589795898

9589895899
output.tick = function (props) {
95899-
/*
9590095900
output.regl.clear({
9590195901
color: [0, 0, 0, 1],
95902-
framebuffer: output.getCurrent(),
95903-
})
95904-
*/
95902+
framebuffer: output.getTexture()
95903+
});
9590595904
output.draw(props);
9590695905
};
9590795906

‎dist/shader-park-core.esm.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.1.38 - January 19, 2023 15:44:27 */
1+
/* Version: 0.1.38 - February 7, 2023 15:08:43 */
22
function createMetadataMethodsForProperty(metadataMap, kind, property) {
33
return {
44
getMetadata: function (key) {
@@ -95879,25 +95879,24 @@ function fragToMinimalRenderer(canvas, fullFrag, updateUniforms) {
9587995879
}
9588095880
}
9588195881

95882-
function sculptToHydraRenderer(source) {
95882+
function sculptToHydraRenderer(source, userUniforms) {
9588395883
var frag = sculptToHydraGLSL(source);
9588495884
return {
9588595885
out: function out(output) {
95886-
var uniforms = {
95886+
var uniforms = _objectSpread2({
9588795887
time: output.regl.prop('time'),
9588895888
opacity: 0.5,
9588995889
_scale: 1.0,
9589095890
resolution: output.regl.prop('resolution'),
9589195891
stepSize: 0.85
95892-
}; // By default hydra doesn't clear the framebuffers
95892+
}, userUniforms); // By default hydra doesn't clear the framebuffers
95893+
9589395894

9589495895
output.tick = function (props) {
95895-
/*
9589695896
output.regl.clear({
9589795897
color: [0, 0, 0, 1],
95898-
framebuffer: output.getCurrent(),
95899-
})
95900-
*/
95898+
framebuffer: output.getTexture()
95899+
});
9590195900
output.draw(props);
9590295901
};
9590395902

‎dist/shader-park-core.umd.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.1.38 - January 19, 2023 15:44:25 */
1+
/* Version: 0.1.38 - February 7, 2023 15:08:41 */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
44
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -95885,25 +95885,24 @@
9588595885
}
9588695886
}
9588795887

95888-
function sculptToHydraRenderer(source) {
95888+
function sculptToHydraRenderer(source, userUniforms) {
9588995889
var frag = sculptToHydraGLSL(source);
9589095890
return {
9589195891
out: function out(output) {
95892-
var uniforms = {
95892+
var uniforms = _objectSpread2({
9589395893
time: output.regl.prop('time'),
9589495894
opacity: 0.5,
9589595895
_scale: 1.0,
9589695896
resolution: output.regl.prop('resolution'),
9589795897
stepSize: 0.85
95898-
}; // By default hydra doesn't clear the framebuffers
95898+
}, userUniforms); // By default hydra doesn't clear the framebuffers
95899+
9589995900

9590095901
output.tick = function (props) {
95901-
/*
9590295902
output.regl.clear({
9590395903
color: [0, 0, 0, 1],
95904-
framebuffer: output.getCurrent(),
95905-
})
95906-
*/
95904+
framebuffer: output.getTexture()
95905+
});
9590795906
output.draw(props);
9590895907
};
9590995908

‎targets/hydraRenderer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
hydraFragFooter,
1111
} from "../glsl/glsl-lib.js";
1212

13-
export function sculptToHydraRenderer(source) {
13+
export function sculptToHydraRenderer(source,userUniforms) {
1414
const frag = sculptToHydraGLSL(source);
1515
return {
1616
out: (output) => {
@@ -20,16 +20,15 @@ export function sculptToHydraRenderer(source) {
2020
_scale: 1.0,
2121
resolution: output.regl.prop('resolution'),
2222
stepSize: 0.85,
23+
...userUniforms
2324
}
2425

2526
// By default hydra doesn't clear the framebuffers
2627
output.tick = (props) => {
27-
/*
2828
output.regl.clear({
2929
color: [0, 0, 0, 1],
30-
framebuffer: output.getCurrent(),
30+
framebuffer: output.getTexture(),
3131
})
32-
*/
3332
output.draw(props)
3433
}
3534

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /