Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to migrate material to default to physical v1 #7100

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/framework/parsers/material/json-standard-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ class JsonStandardMaterialParser {
// or from old versions into current version
migrate(data) {
// replace old shader property with new shadingModel property
if (data.shadingModel === undefined) {
if (data.shader === 'blinn') {
data.shadingModel = SPECULAR_BLINN;
} else {
data.shadingModel = SPECULAR_PHONG;
}
if (data.shader) {
data.shadingModel = data.shader === 'blinn' ? SPECULAR_BLINN : SPECULAR_PHONG;
delete data.shader;
} else if (data.shadingModel === undefined) {
data.shadingModel = SPECULAR_BLINN;
}
if (data.shader) delete data.shader;

// make JS style
if (data.mapping_format) {
Expand Down