Make decorations lit, Rename unlit_decor material to decor.

PiperOrigin-RevId: 933693797
Change-Id: I37128b528296d978d4917ec65316d8d99ce017bb
This commit is contained in:
Yuval Tassa
2026-06-17 06:43:11 -07:00
committed by Copybara-Service
parent 037bdfa519
commit e2afec9153
6 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ var Module = {
"assets/outline_composite.filamat", "assets/outline_composite.filamat",
"assets/outline_flatten.filamat", "assets/outline_flatten.filamat",
"assets/outline_jumpflood.filamat", "assets/outline_jumpflood.filamat",
"assets/unlit_decor.filamat", "assets/decor.filamat",
"assets/unlit_depth.filamat", "assets/unlit_depth.filamat",
"assets/unlit_segmentation.filamat", "assets/unlit_segmentation.filamat",
"assets/unlit_ui.filamat" "assets/unlit_ui.filamat"
+1 -1
View File
@@ -112,7 +112,7 @@ set(MATERIAL_FILES
outline_composite.mat outline_composite.mat
outline_flatten.mat outline_flatten.mat
outline_jumpflood.mat outline_jumpflood.mat
unlit_decor.mat decor.mat
unlit_depth.mat unlit_depth.mat
unlit_segmentation.mat unlit_segmentation.mat
unlit_ui.mat unlit_ui.mat
@@ -1,4 +1,4 @@
// Copyright 2025 DeepMind Technologies Limited // Copyright 2026 DeepMind Technologies Limited
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -13,16 +13,19 @@
// limitations under the License. // limitations under the License.
material { material {
name : unlit_decor, name : decor,
shadingModel : unlit, shadingModel : specularGlossiness,
parameters : [ parameters : [
{ type : float4, name : BaseColorFactor } { type : float4, name : BaseColorFactor }
] ]
} }
fragment { fragment {
void material(inout MaterialInputs material) { void material(inout MaterialInputs material) {
prepareMaterial(material); prepareMaterial(material);
material.baseColor = materialParams.BaseColorFactor; material.baseColor = materialParams.BaseColorFactor;
} material.specularColor = vec3(0.0);
material.glossiness = 0.0;
material.emissive = vec4(0.0);
}
} }
+1 -1
View File
@@ -111,7 +111,7 @@ MaterialManager::MaterialType MaterialManager::GetMaterialType(
if (material.color_texture) { if (material.color_texture) {
return ObjectManager::kUnlitUi; return ObjectManager::kUnlitUi;
} else { } else {
return ObjectManager::kUnlitDecor; return ObjectManager::kDecor;
} }
} else if (material.orm_texture) { } else if (material.orm_texture) {
if (material.opacity_texture) { if (material.opacity_texture) {
+1 -1
View File
@@ -76,7 +76,7 @@ ObjectManager::ObjectManager(filament::Engine* engine) : engine_(engine) {
LoadMaterial(engine, "phong_cube_reflect.filamat"); LoadMaterial(engine, "phong_cube_reflect.filamat");
materials_[kUnlitSegmentation] = materials_[kUnlitSegmentation] =
LoadMaterial(engine, "unlit_segmentation.filamat"); LoadMaterial(engine, "unlit_segmentation.filamat");
materials_[kUnlitDecor] = LoadMaterial(engine, "unlit_decor.filamat"); materials_[kDecor] = LoadMaterial(engine, "decor.filamat");
materials_[kUnlitDepth] = LoadMaterial(engine, "unlit_depth.filamat"); materials_[kUnlitDepth] = LoadMaterial(engine, "unlit_depth.filamat");
materials_[kUnlitUi] = LoadMaterial(engine, "unlit_ui.filamat"); materials_[kUnlitUi] = LoadMaterial(engine, "unlit_ui.filamat");
materials_[kOutlineComposite] = materials_[kOutlineComposite] =
+1 -1
View File
@@ -57,7 +57,7 @@ class ObjectManager {
kPhongCubeFade, kPhongCubeFade,
kPhongCubeReflect, kPhongCubeReflect,
kUnlitSegmentation, kUnlitSegmentation,
kUnlitDecor, kDecor,
kUnlitDepth, kUnlitDepth,
kUnlitUi, kUnlitUi,
kOutlineComposite, kOutlineComposite,