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

Basic materials #262

Closed
vorg opened this issue Nov 20, 2019 · 4 comments
Closed

Basic materials #262

vorg opened this issue Nov 20, 2019 · 4 comments
Labels
type/feat A new feature

Comments

@vorg
Copy link
Member

vorg commented Nov 20, 2019

PEX Renderer is proudly "PBR-First". But this turns out to be quite heavy for development and basic dataviz scenarios. We have unlit but cheap materials like simple diffuse or matcap could help reduce number of cases where we fallback to pex-context.

@dmnsgn
Copy link
Member

dmnsgn commented Nov 20, 2019

Question: should they be part of the core or an update to https://github.com/pex-gl/pex-materials?

@simonharrisco
Copy link
Collaborator

Definite +1 from me, especially for webxr this would be super useful.

@vorg
Copy link
Member Author

vorg commented Nov 20, 2019

@dmnsgn pex-materials are nice starting point but meant to be used with raw pex-context.

To use them with pex-renderer they would need to be split into chunks so I can e.g. import vec4 matcap(sampler2D tex, vec3 n) function and then inject into customized pex-renderer material using the right uniforms and variables like data.normalView.

While that patching could be done in e.g. custom MatCapMaterial node (when in Nodes) it would require significant work to support more advanced renderer features like SSAO or shadowmapping. Although that again should be simpler in the future. I wonder how flexible Node based material in ThreeJS is for this kind of cherrypicked shader development.

Another downside of making this kind of simpler materials by string replacing chunks in PBR shader is that while lighting model is simpler it's still a mega uber shader that depends on GLSL compiler to remove unused code and uniforms during compilation. Also our render pipeline still collects all the possible uniform data even if shader ends up not using it e.g. reflection probes and light colors are saved in uniforms array of material with unlit: true. At least the data will be not sent as we submit only active uniforms to the GPU

@dmnsgn dmnsgn added the type/feat A new feature label Oct 19, 2022
@dmnsgn
Copy link
Member

dmnsgn commented Oct 19, 2022

Duplicate #311

@dmnsgn dmnsgn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat A new feature
Projects
None yet
Development

No branches or pull requests

3 participants