playcanvas / playcanvas/engine

Refactor MeshInstance.setParameter

Open
#3,422 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: graphics enhancement
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

There are two issues with the current implementation:

  1. The interface is different than setting those properties on the Material, and requires setting up uniforms directly, which is an internal detail of the engine.
  2. It only allows to overwrite a property that is set up on material. If Material does not have a property (for example emissive texture), the shader which gets compiled does not support this property, and setting it on MeshInstance is ignored as the shader does not need the uniform, and its not recompiled to support it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating MeshInstance.setParameter and the related Material and shader-compilation paths. Compare MeshInstance parameter setting with Material property setting, then trace how missing Material properties affect shader uniforms. Done means the interface and unsupported-property behavior are defined and covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.