sessamekesh / indigocs-webgl-tutorials Goto Github PK
View Code? Open in Web Editor NEWGit repository accompanying the WebGL tutorials featured on the IndigoCS YouTube channel.
Git repository accompanying the WebGL tutorials featured on the IndigoCS YouTube channel.
Promises and fetch is one of ES6 features and should be used to chain asynchronously.
Here's an example:
Promise.all([
loadText('shader/vs.glsl'),
loadText('shader/fs.glsl'),
loadJSON('sphere.json'),
loadImage('tex/soccer.png'),
loadImage('tex/crate.png')
]).then(([vertexShaderText,fragmentShaderText,sphereJson,soccerImage,crateImage])=>{
let vertexShader = new Shader.VertexShader(gl).create(vertexShaderText);
let fragmentShader = new Shader.FragmentShader(gl).create(fragmentShaderText);
let shaderProgram = new ShaderProgram(gl).attachShader(vertexShader,fragmentShader);
return Promise.all([
new Ball(gl,shaderProgram,sphereJson,soccerImage),
new Crate(gl,shaderProgram,crateImage)
])
}).then(([soccerObj, crateObj]) => {
ball = soccerObj;
crate = crateObj;
setTimeout(start,1000);
});
You can find the full code here
Hi Kamaron!
I watched your shadow mapping tutorial today, first of all, great job!
I have kind of a question/issue about your code.
I did the following:
I am working on a project that has multiple rooms. I don't want the light from one room being visible in others which is logical. Project is for the university and I am not allowed to use 3rd party software (only glmatrix).
Many Thanks
Behzad
Hello:
i need to constant translation 05 - Phong Lighting Intro ..i try to use mat4 but dosent work for me. can you show me how to translate it please?
$ make
jshint lib/async.js test/*.js mocha_test/* perf/*.js
ERROR: Can't open test/*.js
lib/async.js: line 319, col 55, Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (running, callback, errored, replenish)
mocha_test/compose.js: line 24, col 36, Expected an assignment or function call and instead saw an expression.
mocha_test/compose.js: line 54, col 39, Expected an assignment or function call and instead saw an expression.
mocha_test/compose.js: line 55, col 42, Expected an assignment or function call and instead saw an expression.
mocha_test/compose.js: line 79, col 32, Expected an assignment or function call and instead saw an expression.
perf/memory.js: line 14, col 33, Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (async)
6 errors
make: *** [lint] Error 2
and test folder isn't even there...
$ ls
CHANGELOG.md README.md deps lib perf
LICENSE bower.json dist mocha_test support
Makefile component.json karma.conf.js package.json
Kamaron,
In the second tutorial, towards the end you moved var gl
to global, in order to test some stuff in the browser console.
It looks like this ended up in the source code, so I propose moving it back to local.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.