How to use the color.frag function in color

To help you get started, we’ve selected a few color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leon196 / NaturallyUndead / scripts / scenes / mainScene.js View on Github external
this.moss = new Moss(createMesh(assets["skull.ply"]));
		this.mossLeafSize = [0.5, 4.];
		this.moss.setLeafSize(this.mossLeafSize);
		this.moss.setCurve(this.curve1);
		this.moss.setColors([152. / 255., 177. / 255., 109. / 255.], [35. / 255., 66. / 255., 9. / 255.]);

		this.mossRed = new Moss(createMesh(assets["skull.ply"]));
		this.mossRed.setLeafSize([0.5, 2.]);
		this.mossRed.setColors([0.8, 0.08, 0.15], [0.07, 0, 0]);
		this.mossRed.setRadius(3);

		this.grid = new Entity(createGrid(), assets["color.vert"], assets["color.frag"]);
		this.grid.displayType = gl.LINES;

		this.targetBush = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		this.targetBush.displayType = gl.LINES;

		// this.targetBoids = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		// this.targetBoids.displayType = gl.LINES;

		this.butterflies = new Butterflies();

		this.painting = new Painting(createQuads(gl, 128, 128, { x: 0.5, y: 0.5 }));
		this.painting.setSize([0.04, 0.08]);
		this.paintingFrame = new FrameBuffer();
		this.paintingFrame.createBuffer(gl, gl.drawingBufferWidth, gl.drawingBufferHeight, 1);

		// this.textTitle = new CoolText("Naturally\nUndead\nEvoke 2016", 0, 7);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
		this.textTitle2 = new CoolText("Naturally\nUndead\nEvoke 2016", 100, 8);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
		this.textCredits1 = new CoolText("Visual by\nPONK\nMusic by\nDOK", 108, 8);
		// this.textCredits2 = new CoolText("Skull scanned by\nDoug Boyer from\nDuke University", 169, 12);
github leon196 / NaturallyUndead / scripts / scenes / mainScene.js View on Github external
this.character = new Character(this.curve1);

		this.skull = new Skull();

		this.moss = new Moss(createMesh(assets["skull.ply"]));
		this.mossLeafSize = [0.5, 4.];
		this.moss.setLeafSize(this.mossLeafSize);
		this.moss.setCurve(this.curve1);
		this.moss.setColors([152. / 255., 177. / 255., 109. / 255.], [35. / 255., 66. / 255., 9. / 255.]);

		this.mossRed = new Moss(createMesh(assets["skull.ply"]));
		this.mossRed.setLeafSize([0.5, 2.]);
		this.mossRed.setColors([0.8, 0.08, 0.15], [0.07, 0, 0]);
		this.mossRed.setRadius(3);

		this.grid = new Entity(createGrid(), assets["color.vert"], assets["color.frag"]);
		this.grid.displayType = gl.LINES;

		this.targetBush = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		this.targetBush.displayType = gl.LINES;

		// this.targetBoids = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		// this.targetBoids.displayType = gl.LINES;

		this.butterflies = new Butterflies();

		this.painting = new Painting(createQuads(gl, 128, 128, { x: 0.5, y: 0.5 }));
		this.painting.setSize([0.04, 0.08]);
		this.paintingFrame = new FrameBuffer();
		this.paintingFrame.createBuffer(gl, gl.drawingBufferWidth, gl.drawingBufferHeight, 1);

		// this.textTitle = new CoolText("Naturally\nUndead\nEvoke 2016", 0, 7);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
github leon196 / leon196.github.io / NaturallyUndead / scripts / scenes / mainScene.js View on Github external
this.character = new Character(this.curve1);

		this.skull = new Skull();

		this.moss = new Moss(createMesh(assets["skull.ply"]));
		this.mossLeafSize = [0.5, 4.];
		this.moss.setLeafSize(this.mossLeafSize);
		this.moss.setCurve(this.curve1);
		this.moss.setColors([152. / 255., 177. / 255., 109. / 255.], [35. / 255., 66. / 255., 9. / 255.]);

		this.mossRed = new Moss(createMesh(assets["skull.ply"]));
		this.mossRed.setLeafSize([0.5, 2.]);
		this.mossRed.setColors([0.8, 0.08, 0.15], [0.07, 0, 0]);
		this.mossRed.setRadius(3);

		this.grid = new Entity(createGrid(), assets["color.vert"], assets["color.frag"]);
		this.grid.displayType = gl.LINES;

		this.targetBush = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		this.targetBush.displayType = gl.LINES;

		// this.targetBoids = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		// this.targetBoids.displayType = gl.LINES;

		this.butterflies = new Butterflies();

		this.painting = new Painting(createQuads(gl, 128, 128, { x: 0.5, y: 0.5 }));
		this.painting.setSize([0.04, 0.08]);
		this.paintingFrame = new FrameBuffer();
		this.paintingFrame.createBuffer(gl, gl.drawingBufferWidth, gl.drawingBufferHeight, 1);

		// this.textTitle = new CoolText("Naturally\nUndead\nEvoke 2016", 0, 7);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
github leon196 / leon196.github.io / NaturallyUndead / scripts / scenes / mainScene.js View on Github external
this.moss = new Moss(createMesh(assets["skull.ply"]));
		this.mossLeafSize = [0.5, 4.];
		this.moss.setLeafSize(this.mossLeafSize);
		this.moss.setCurve(this.curve1);
		this.moss.setColors([152. / 255., 177. / 255., 109. / 255.], [35. / 255., 66. / 255., 9. / 255.]);

		this.mossRed = new Moss(createMesh(assets["skull.ply"]));
		this.mossRed.setLeafSize([0.5, 2.]);
		this.mossRed.setColors([0.8, 0.08, 0.15], [0.07, 0, 0]);
		this.mossRed.setRadius(3);

		this.grid = new Entity(createGrid(), assets["color.vert"], assets["color.frag"]);
		this.grid.displayType = gl.LINES;

		this.targetBush = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		this.targetBush.displayType = gl.LINES;

		// this.targetBoids = new Entity(createWiredCube(), assets["color.vert"], assets["color.frag"]);
		// this.targetBoids.displayType = gl.LINES;

		this.butterflies = new Butterflies();

		this.painting = new Painting(createQuads(gl, 128, 128, { x: 0.5, y: 0.5 }));
		this.painting.setSize([0.04, 0.08]);
		this.paintingFrame = new FrameBuffer();
		this.paintingFrame.createBuffer(gl, gl.drawingBufferWidth, gl.drawingBufferHeight, 1);

		// this.textTitle = new CoolText("Naturally\nUndead\nEvoke 2016", 0, 7);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
		this.textTitle2 = new CoolText("Naturally\nUndead\nEvoke 2016", 100, 8);//, ["rgb(0,250,0)", "rgb(250,0,0)", "white"]);
		this.textCredits1 = new CoolText("Visual by\nPONK\nMusic by\nDOK", 108, 8);
		// this.textCredits2 = new CoolText("Skull scanned by\nDoug Boyer from\nDuke University", 169, 12);
github leon196 / leon196.github.io / NaturallyUndead / scripts / entities / elements / bush.js View on Github external
function Bush (gridSize)
{
	var points = [];
	var count = gridSize[0] * gridSize[1] * gridSize[2];
	for (var i = 0; i < count; ++i) {	
		var x = i % gridSize[0];
		var y = Math.floor(i / (gridSize[0] * gridSize[2]));
		var z = Math.floor(i / gridSize[0]) % gridSize[2];
		var point = { x: x, y: y, z: z };
		point.normal = { x: 0, y: 1, z: 0 };
		point.color = { r: 0, g: .8, b: 0, a: 1 };
		points.push(point);
	}

	Entity.call(this, createLeaves(points), assets["bush.vert"], assets["color.frag"], {
		u_gridSize: gridSize,
		u_voxelSize: 1.,
		u_leafSize: [1,1],
		u_displacementScale: [0.5,0.5,0.5],
		u_noiseRange: [1,1,1],
		u_target: [0,0,0],
	});

	this.setVoxelSize 					= function (value) { this.shader.uniforms.u_voxelSize = value; };
	this.setLeafSize 						= function (value) { this.shader.uniforms.u_leafSize = value; };
	this.setDisplacementScale 	= function (value) { this.shader.uniforms.u_displacementScale = value; };
	this.setNoiseScale 					= function (value) { this.shader.uniforms.u_noiseRange = value; };
	this.setTarget 							= function (value) { this.shader.uniforms.u_target = value; };
	this.setValue 							= function (value) { this.shader.uniforms.u_value = value; };
}
github leon196 / leon196.github.io / NaturallyUndead / scripts / entities / bases / pointCloud.js View on Github external
function PointCloud (assetName, step)
{
	this.data = parsePointCloud(assets[assetName], step || 20);
	Entity.call(this, createLeaves(this.data.points), assets["leaf.vert"], assets["color.frag"], {
		u_leafSize: [1, 1],
		u_target: this.data.middle,
		u_value: 1,
	});

	this.middle = this.data.middle;

	this.setLeafSize = function (value) { this.shader.uniforms.u_leafSize = value; };
	this.setTarget = function (value) { this.shader.uniforms.u_target = value; };
}