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

Support shader replacement and sub shader #1394

Merged
merged 63 commits into from
Mar 13, 2023

Conversation

GuoLei1990
Copy link
Member

@GuoLei1990 GuoLei1990 commented Mar 5, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Main modifies:

  • Camera support shader replace by setReplacementShader() and resetReplacementShader()
  // Set replacement shader
  camera.setReplacementShader(pickShader, subShaderReplacementTag);

  // Clear replacement shader
  camera.resetReplacementShader();
  • Shader support add SubShader
  • ShaderPass and SubShader support tags( used for "link render pipeline" or "camera replace shader" etc.)
  • BasicRenderPipeline support pipeline stage, developer can write shadow caster pass and forward render pass in the same shader by different PipelineStage tag
Shader.create("CustomShader", [
new ShaderPass(pbrVs, pbrFs, {PipelineStage: "Forward"}), 
new ShaderPass(shadowMapVs, shadowMapFs, {PipelineStage: "ShadowCaster"})
]);
  • dependentComponents decorator support check only mode

@GuoLei1990 GuoLei1990 added the enhancement New feature or request label Mar 5, 2023
@GuoLei1990 GuoLei1990 marked this pull request as draft March 6, 2023 03:12
Copy link
Member

@singlecoder singlecoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@GuoLei1990 GuoLei1990 merged commit 2e63d63 into galacean:dev/1.0 Mar 13, 2023
GuoLei1990 added a commit to GuoLei1990/galacean-engine that referenced this pull request Mar 13, 2023
* dev/1.0:
  Support shader replacement and sub shader (galacean#1394)
@GuoLei1990 GuoLei1990 linked an issue Mar 15, 2023 that may be closed by this pull request
GuoLei1990 added a commit to GuoLei1990/galacean-engine that referenced this pull request Mar 16, 2023
* dev/1.0: (41 commits)
  fix: package.json
  Support device lost  (galacean#1374)
  "v0.9.0-beta.70"
  fix: add shadow parser (galacean#1411)
  Add `toJSON` in base math class (galacean#1380) (galacean#1409)
  refactor(particle): Add an infinite bounding box to the particle system and it will never be clipped (galacean#1410)
  "v0.9.0-beta.69"
  Fix glTF SkinnedMeshRenderer default local bounds (galacean#1405)
  Support shader replacement and sub shader (galacean#1394)
  Fix camera cull bug (galacean#1396)
  "v0.9.0-beta.68"
  fix: InputManager default listener target
  "v0.9.0-beta.67"
  Fix shader compile performance on some windows device (galacean#1390)
  Move font map cache from `Font` to `Engine` (galacean#1387)
  "v1.0.0-alpha.0"
  glTF parse support custom extsnions and parser (galacean#1008)
  Optimization `Transform` direction related API (galacean#1381)
  refactor: opt code
  refactor: opt code
  ...
@GuoLei1990 GuoLei1990 deleted the pr/replace-shader branch September 18, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shader Shader related functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Engine add shader replace and replaceTag feat
5 participants