Skip to content

Commit

Permalink
Merge branch 'main' into texture-array-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
heretique committed Jul 9, 2024
2 parents 50cbd9b + 18aee53 commit 43c5e2a
Show file tree
Hide file tree
Showing 290 changed files with 3,423 additions and 3,508 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ assetListLoader.load(() => {
const gameScreenMaterial = gameScreen.render.material;
gameScreenMaterial.diffuse = pc.Color.BLACK;
gameScreenMaterial.emissiveMap = outputTexture;
gameScreenMaterial.emissive = pc.Color.WHITE;
gameScreenMaterial.useLighting = false;
gameScreenMaterial.update();
app.root.addChild(gameScreen);
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/mesh-decals.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ assetListLoader.load(() => {
material.blendType = pc.BLEND_ADDITIVEALPHA; // additive alpha blend
material.depthWrite = false; // optimization - no need to write to depth buffer, as decals are part of the ground plane
material.emissiveMap = assets.heart.resource;
material.emissive = pc.Color.WHITE;
material.opacityMap = assets.heart.resource;
material.depthBias = -0.1; // depth biases to avoid z-fighting with ground plane
material.slopeDepthBias = -0.1;
Expand Down
5 changes: 3 additions & 2 deletions examples/src/examples/graphics/painter.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ app.on('destroy', () => {
*/
function createPrimitive(primitiveType, position, scale, layer, material) {
// create primitive
const primitive = new pc.Entity();
const primitive = new pc.Entity(`Brush-${primitiveType}`);
primitive.addComponent('render', {
type: primitiveType,
layers: layer,
Expand Down Expand Up @@ -91,7 +91,6 @@ app.scene.layers.insert(paintLayer, 0);

// create a material we use for the paint brush - it uses emissive color to control its color, which is assigned later
const brushMaterial = new pc.StandardMaterial();
brushMaterial.emissiveTint = true;
brushMaterial.useLighting = false;
brushMaterial.update();

Expand Down Expand Up @@ -141,7 +140,9 @@ app.root.addChild(camera);

// material used to add render target into the world
const material = new pc.StandardMaterial();
material.name = 'EmissiveMaterial';
material.emissiveMap = texture;
material.emissive = pc.Color.WHITE;
material.useLighting = false;
material.update();

Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/reflection-box.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ assetListLoader.load(() => {
const screenMaterial = new pc.StandardMaterial();
screenMaterial.useLighting = false;
screenMaterial.emissiveMap = videoTexture;
screenMaterial.emissive = pc.Color.WHITE;
screenMaterial.update();

/**
Expand Down
2 changes: 2 additions & 0 deletions examples/src/examples/graphics/render-to-texture.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,11 @@ assetListLoader.load(() => {
tv.setLocalEulerAngles(90, 0, 0);
tv.render.castShadows = false;
tv.render.receiveShadows = false;

/** @type {pc.StandardMaterial} */
const material = tv.render.material;
material.emissiveMap = texture; // assign the rendered texture as an emissive texture
material.emissive = pc.Color.WHITE;
material.update();

// setup skydome, use top mipmap level of cubemap (full resolution)
Expand Down
1 change: 0 additions & 1 deletion examples/src/examples/graphics/texture-basis.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ assetListLoader.load(() => {
// Construct material
const material = new pc.StandardMaterial();
material.useMetalness = true;
material.diffuse = new pc.Color(0.3, 0.3, 0.3);
material.gloss = 0.8;
material.metalness = 0.7;
material.diffuseMap = assets.color.resource;
Expand Down
1 change: 1 addition & 0 deletions examples/src/examples/graphics/video-texture.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ assetListLoader.load(() => {
const material = new pc.StandardMaterial();
material.useLighting = false;
material.emissiveMap = videoTexture;
material.emissive = pc.Color.WHITE;
material.update();

// set the material on the screen mesh
Expand Down
147 changes: 87 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
"error",
{
"definedTags": [
"attribute",
"category",
"attribute"
"import"
]
}
]
Expand Down Expand Up @@ -132,9 +133,9 @@
"rollup-plugin-visualizer": "^5.12.0",
"serve": "^14.2.2",
"sinon": "^17.0.1",
"typedoc": "^0.25.13",
"typedoc-plugin-mdn-links": "^3.1.22",
"typescript": "^5.4.5",
"typedoc": "^0.26.3",
"typedoc-plugin-mdn-links": "^3.2.2",
"typescript": "^5.5.3",
"xhr2": "^0.2.1"
},
"scripts": {
Expand Down
Loading

0 comments on commit 43c5e2a

Please sign in to comment.