I am thrilled to announce that Social Street View has won the Best Paper Award at Web3D 2016, which was held next to SIGGRAPH 2016 in late August! Please visit the project website for more details: http://www.socialstreetview.com I also published my slides and videos.
Uniforms Types in Three.js
Here is a a cheat sheet for uniform types in Three.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
var uniformsExample = { "uInt" : { type: "i", value: 1 }, // single integer "uFloat" : { type: "f", value: 3.14 }, // single float "uVec2" : { type: "v2", value: new THREE.Vector2( 0, 1 ) }, // single Vector2 "uVec3" : { type: "v3", value: new THREE.Vector3( 0, 1, 2 ) }, // single Vector3 "uVec4" : { type: "v4", value: new THREE.Vector4( 0, 1, 2, 3 ) }, // single Vector4 "uCol" : { type: "c", value: new THREE.Color( 0xffaa00 ) }, // single Color "uMat4" : { type: "m4", value: new THREE.Matrix4() }, // single Matrix4 "uTex" : { type: "t", value: THREE.ImageUtils.loadTexture( "texture.jpg" ) }, // regular texture "uTexCube" : { type: "t", value: THREE.ImageUtils.loadTextureCube( [ "px.jpg", "nx.jpg", // cube texture "py.jpg", "ny.jpg", "pz.jpg", "nz.jpg" ] ) }, "uIntArray" : { type: "iv1", value: [ 1, 2, 3, 4, 5 ] }, // integer array (plain) "uIntArray3" : { type: "iv", value: [ 1, 2, 3, 4, 5, 6 ] }, // integer array (ivec3) "uFloatArray" : { type: "fv1", value: [ 0.1, 0.2, 0.3, 0.4, 0.5 ] }, // float array (plain) "uFloatArray3" : { type: "fv", value: [ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ] }, // float array (vec3) "uVec2Array" : { type: "v2v", value: [ new THREE.Vector2( 0.1, 0.2 ), new THREE.Vector2( 0.4, 0.5 ) ] }, // Vector2 array "uVec3Array" : { type: "v3v", value: [ new THREE.Vector3( 0.1, 0.2, 0.3 ), new THREE.Vector3( 0.4, 0.5, 0.6 ) ] }, // Vector3 array "uVec4Array" : { type: "v4v", value: [ new THREE.Vector4( 0.1, 0.2, 0.3, 0.4 ), new THREE.Vector4( 0.4, 0.5, 0.6, 0.7 ) ] }, // Vector4 array "uMat4Array" : { type: "m4v", value: [ new THREE.Matrix4(), new THREE.Matrix4() ] }, // Matrix4 array "uTexArray" : { type: "tv", value: [ new THREE.Texture(), new THREE.Texture() ] } // texture array (regular) }; |
Here is how to cite them in GLSL:
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
uniform int uInt; uniform float uFloat; uniform vec2 uVec2; uniform vec3 uVec3; uniform vec4 uVec4; uniform vec3 uCol; uniform mat4 uMat4; uniform sampler2D uTex; uniform samplerCube uTexCube; uniform int uIntArray[ 5 ]; uniform ivec3 uIntArray3[ 2 ]; uniform float uFloatArray[ 5 ]; uniform vec3 uFloatArray3[ 2 ]; uniform vec2 uVec2Array[ 2 ]; uniform vec3 uVec3Array[ 2 ]; uniform vec4 uVec4Array[ 2 ]; uniform mat4 uMat4Array[ 2 ]; uniform sampler2D uTexArray[ 2 ]; |
Tutorial and Resources for Three.js
Three.js is one of a number of free WebGL libraries. First released in April 2010, it has become pretty popular, and includes a huge number of demos. I wanted to know more about its origins, so interviewed its creator, Ricardo Cabello, aka mr.doob, who lives in Spain. Interestingly, I am also largely motivated by Demoscenes when I was…
March 2021 M T W T F S S « Nov 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Clock
World
Random Posts
- Reviews of Google Spotlight Stories vs SIGGRAPH Paper HQ Free-Viewpoint Video by MS
- 2015 Internet Trends Report
- Output M Numbers from [0, N-1], N >> M
- [Talk] Sketch-based 3D Shape Retrieval using Convolutional Neural Networks
- [Talk Summary] A large-scale analysis of YouTube videos depicting everyday thermal camera use
Share
Slideshow
-
Recent Posts
- Wearable Interactions Using Touch without a Touchscreen
- [Talk Summary] HandSight: A Touch-Based Wearable System to Increase Information Accessibility for People with Visual Impairments
- [Talk Summary] A large-scale analysis of YouTube videos depicting everyday thermal camera use
- [Summary] Google I/O and Microsoft Build 2018
- [Summary] StackGAN: Text to Photo-realistic Image Synthesis
Twitter
My TweetsRecent Comments
- CS475 Algorithm Analysis and Design – Course | Ruofei Du on Treap in 45 lines of C++
- MA066 Advanced Algebra I – Course | Ruofei Du on Gradient, Circulation, Laplacian, Divergence, Jacobian, Hessian, and Trace
- Mr Zhu (@834144373zhu) on Tutorial of Ray Casting, Ray Tracing, Path Tracing and Ray Marching
- サンプリングレンダリングの解説記事 – Tech masuk on Tutorial of Ray Casting, Ray Tracing, Path Tracing and Ray Marching
- starea on Estimated Cost of Per Atom Function in Real-time Shaders on the GPU
Archives
- November 2018
- August 2018
- May 2018
- April 2018
- March 2018
- November 2017
- October 2017
- August 2017
- July 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- June 2016
- April 2016
- March 2016
- February 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- September 2014
- September 2012
- October 2010
- May 2010
- July 2008
Categories
Meta