fixing graphs
This commit is contained in:
parent
b79b4831c6
commit
dd6613f98d
|
|
@ -26,7 +26,7 @@ void main(){
|
|||
|
||||
float pct = 0.0;
|
||||
vec2 st_i = floor(st*10.);
|
||||
pct += step(0.5,abs(mod(st_i.x,2.)-mod(st_i.y+1.,2.)));
|
||||
pct += abs(mod(st_i.x,2.)-mod(st_i.y,2.));
|
||||
|
||||
gl_FragColor = vec4(vec3(pct),1.0);
|
||||
}
|
||||
11
graph.html
11
graph.html
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
<!-- GLSL Canvas -->
|
||||
<script type='text/javascript' src='https://thebookofshaders.com/glslCanvas/GlslCanvas.js'></script>
|
||||
<link type='text/css' rel='stylesheet' href='https://thebookofshaders.com/glslEditor/glslEditor.css'>
|
||||
<script type='application/javascript' src='https://thebookofshaders.com/glslEditor/glslEditor.js'></script>
|
||||
<!-- <link type='text/css' rel='stylesheet' href='https://thebookofshaders.com/glslEditor/glslEditor.css'>
|
||||
<script type='application/javascript' src='https://thebookofshaders.com/glslEditor/glslEditor.js'></script> -->
|
||||
<link type="text/css" rel="stylesheet" href="http://localhost:9966/build/glslEditor.css">
|
||||
<script type="application/javascript" src="http://localhost:9966/build/glslEditor.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
|
|
@ -169,11 +171,14 @@ void main(){\n\
|
|||
window.glslEditor = new GlslEditor('#glsl_editor', {
|
||||
canvas_width: 900,
|
||||
canvas_height: 300,
|
||||
canvas_follow: true,
|
||||
canvas_float: false,
|
||||
lineNumbers: false,
|
||||
frag_header: preFunction,
|
||||
frag_footer: postFunction,
|
||||
frag: funct,
|
||||
multipleBuffers: true
|
||||
}).open(funct);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@
|
|||
|
||||
<!-- GlslEditor -->
|
||||
<?php
|
||||
// echo '
|
||||
// <link type="text/css" rel="stylesheet" href="http://localhost:9966/build/glslEditor.css">
|
||||
// <script type="application/javascript" src="http://localhost:9966/build/glslEditor.js"></script>';
|
||||
if (file_exists($path."/src/glslEditor/build/glslEditor.js")) {
|
||||
echo '
|
||||
<link type="text/css" rel="stylesheet" href="'.$path.'/src/glslEditor/build/glslEditor.css">
|
||||
|
|
|
|||
19
src/main.js
19
src/main.js
|
|
@ -137,7 +137,13 @@ function loadGlslElements() {
|
|||
for(var i = 0; i < ccList.length; i++){
|
||||
if (ccList[i].hasAttribute("data")){
|
||||
var srcFile = ccList[i].getAttribute("data");
|
||||
var editor = new GlslEditor(ccList[i], { canvas_size: 250, canvas_follow: true, tooltips: true, exportIcon: true });
|
||||
var editor = new GlslEditor(ccList[i], {
|
||||
canvas_size: 250,
|
||||
canvas_follow: true,
|
||||
canvas_float: 'right',
|
||||
tooltips: true,
|
||||
exportIcon: true
|
||||
});
|
||||
editor.open(srcFile);
|
||||
glslEditors.push(editor);
|
||||
}
|
||||
|
|
@ -148,7 +154,16 @@ function loadGlslElements() {
|
|||
for(var i = 0; i < sfList.length; i++){
|
||||
if (sfList[i].hasAttribute("data")){
|
||||
var srcFile = sfList[i].getAttribute("data");
|
||||
glslGraphs.push(new GlslEditor(sfList[i], { canvas_width: 800, lineNumbers: false, canvas_height: 250, frag_header: preFunction, frag_footer: postFunction, tooltips: true }).open(srcFile));
|
||||
glslGraphs.push(new GlslEditor(sfList[i], {
|
||||
canvas_width: 800,
|
||||
lineNumbers: false,
|
||||
canvas_height: 250,
|
||||
canvas_follow: true,
|
||||
canvas_float: false,
|
||||
frag_header: preFunction,
|
||||
frag_footer: postFunction,
|
||||
tooltips: true
|
||||
}).open(srcFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue