-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3820 from sanketsingh24/feature-emissive
Feature implementation: emissiveMaterial()
- Loading branch information
Showing
9 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
test/manual-test-examples/webgl/material/emissive/index.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title></title> | ||
<link rel="stylesheet" href="../../../styles.css"> | ||
<script language="javascript" type="text/javascript" src="../../../../../lib/p5.js"></script> | ||
<script language="javascript" type="text/javascript" src="sketch.js"></script> | ||
<script src="../../stats.js"></script> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
</html> |
32 changes: 32 additions & 0 deletions
32
test/manual-test-examples/webgl/material/emissive/sketch.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function setup() { | ||
createCanvas(windowWidth, windowHeight, WEBGL); | ||
// setAttributes('perPixelLighting', true); | ||
} | ||
|
||
function draw() { | ||
background(0); | ||
|
||
var locY = mouseY - height / 2; | ||
var locX = mouseX - width / 2; | ||
|
||
ambientLight(100); | ||
pointLight(200, 200, 200, locX, locY, 0); | ||
|
||
translate(-200, 0, 0); | ||
push(); | ||
ambientMaterial(250); | ||
rotateZ(frameCount * 0.02); | ||
rotateX(frameCount * 0.02); | ||
rotateY(frameCount * 0.02); | ||
torus(80, 20, 64, 64); | ||
pop(); | ||
|
||
translate(400, 0, 0); | ||
push(); | ||
emissiveMaterial(200, 0, 0); | ||
rotateZ(frameCount * 0.02); | ||
rotateX(frameCount * 0.02); | ||
rotateY(frameCount * 0.02); | ||
torus(81, 20, 64, 64); | ||
pop(); | ||
} |
This file contains 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
This file contains 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