This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* MyClass | |
* | |
* @class MyClass | |
* @author David Ronai http://makiopolis.com/ @Makio64 | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* MySingleton | |
* | |
* @class MySingleton | |
* @author David Ronai http://makiopolis.com/ @Makio64 | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Utility class to manage pool of objects | |
class ObjectPool | |
constructor: (@create, @minSize, @maxSize) -> | |
@list = [] | |
for [0...@minSize] | |
@add() | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stage3d = require('makio/core/Stage3d') | |
class FBO | |
constructor:( width, height, @renderer, @simulation )-> | |
#---------------------------------------------------------------------------------------- Create Render | |
options = { | |
wrapS: THREE.RepeatWrapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimized by @makio64 - FabriceNeyret2 | |
// Original post on shadertoy: https://www.shadertoy.com/view/4sdGD8 | |
// Original : https://github.com/ashima/webgl-noise/blob/master/src/noise2D.glsl | |
vec3 permute(vec3 x) { return mod( x*x*34.+x, 289.); } | |
float snoise(vec2 v) { | |
vec2 i = floor(v + (v.x+v.y)*.36602540378443), | |
x0 = v - i + (i.x+i.y)*.211324865405187, | |
j = step(x0.yx,x0), | |
x1 = x0-j+.211324865405187, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimized AshimaSimplexNoise by @makio64 | |
// Original post on shadertoy : https://www.shadertoy.com/view/Xd3GRf | |
// Original : https://github.com/ashima/webgl-noise/blob/master/src/noise3D.glsl | |
vec4 permute(vec4 x){return mod(x*x*34.+x,289.);} | |
float snoise(vec3 v){ | |
const vec2 C = 1./vec2(6,3); | |
const vec4 D = vec4(0,.5,1,2); | |
vec3 i = floor(v + dot(v, C.yyy)); | |
vec3 x0 = v - i + dot(i, C.xxx); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\S*\s+(\S*)\s*=[ ]*require\(\s*["'](.*)["']\s*\)\s*;? | |
import $1 from '$2' | |
before: | |
const bouboup = require( 'blabla/bouboup' ) | |
after: | |
import bouboup from 'blabla/bouboup' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Worklow | |
### branches | |
- **develop** : *remote* branch with all versions | |
- **local** : *local* branch with local version | |
### workflow | |
1. After cloning the project, create a **local** branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Global : | |
- Dont use PIXI.Graphics | |
- render elements in the order of atlas/textures used : for 2 atlas or texture A & B, then render elements using AAAABBB instead of ABABABA | |
- On branch next from Pixi there is PIXI.mesh.Geometry & shaders very good for perf | |
http://dev.goodboydigital.com/client/goodboy/geometry/examples/index.html#/mesh/uniforms.js | |
- prefer generateSprite to cacheasbitmap to cache container/no animated element | |
Spritesheets: | |
- Use spritesheets whenever its possible | |
- Scales them down to 50% on mobile/tablet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class MeshCustomMaterial extends THREE.MeshStandardMaterial { | |
constructor(parameters, uniforms={}, fs=null , vs=null ){ | |
fs = fs || ` | |
#define PHYSICAL | |
uniform vec3 diffuse; | |
uniform vec3 emissive; | |
uniform float roughness; | |
uniform float metalness; | |
uniform float opacity; |
OlderNewer