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

New materials become Phong shaded in old engines #1239

Open
aidinabedi opened this issue Dec 11, 2024 · 4 comments
Open

New materials become Phong shaded in old engines #1239

aidinabedi opened this issue Dec 11, 2024 · 4 comments
Assignees

Comments

@aidinabedi
Copy link

Description

New materials created in the editor (after v1.47.0) don't get a shader property. This causes the materials to be phong shaded when used in engine version 1.75.0 or older (see json-standard-material.js line 105). Although this issue doesn't happen in newer engine versions, a lot of projects (ours included) are still on much older engine versions than 1.75.0.

Steps to Reproduce

  1. Open simple project that demonstrates the issue.
  2. Open scene Untitled and launch it.
  3. Observe that the materials have the same shading model blinn:
    image
  4. Launch the same scene with engine version 1.75.0 or older (using use_local_engine)
  5. Observe that the New Material no longer has shading model blinn:
    image
@kpal81xd
Copy link

@aidinabedi So we only officially support the latest version and previous minor in our editor. Unfortunately this means engines prior to v1.75.1 have phong as the default shading model as opposed to physical in newer versions. Maintaining multiple versions of engines in the editor its very strenuous on our team as they will require difference schema changes and ultimately keeping legacy support restricts our ability and scope to add new features to the engine/editor.

If you would like to stick to older engines in the editor the best solution IMO is:

  1. Monkey-patch the engine version and build from source
  2. Copy the built engine into project and mark the Loading Type as After Engine to override the current engine in the launcher and for published projects

@mvaligursky
Copy link

@AlbertoMalavasi
Copy link

This issue has affected us as well. We export packages from the PlayCanvas Editor that are used elsewhere with older versions of the engine. Quickly updating from one version to the next is somewhat complicated due to shaders and other custom scripts we need to maintain and update.

The quickest fix we’ve found is to manually add "shader": "blinn" to each Material Asset’s data, in the config.json. This step can be automated post-export with a simple script.

Interestingly, we noticed that some materials still included "shader": "blinn" even when exported from the newest version of the editor.

Screenshot 2024-12-16 at 16 51 29 Screenshot 2024-12-16 at 16 34 24

What do you think?
Thanks,

@kpal81xd
Copy link

This issue has affected us as well. We export packages from the PlayCanvas Editor that are used elsewhere with older versions of the engine. Quickly updating from one version to the next is somewhat complicated due to shaders and other custom scripts we need to maintain and update.

The quickest fix we’ve found is to manually add "shader": "blinn" to each Material Asset’s data, in the config.json. This step can be automated post-export with a simple script.

Interestingly, we noticed that some materials still included "shader": "blinn" even when exported from the newest version of the editor.

Screenshot 2024-12-16 at 16 51 29 Screenshot 2024-12-16 at 16 34 24
What do you think? Thanks,

So initially we had removed the property shader entirely from the editor but due to doing release reverts we decided to keep it in and force it to blinn. This however only occurs for engines >=1.75.1. If you are using engines older than the latest available in the editor then we do not support this data migration so you adding the value in manually makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants