Git Product home page Git Product logo

Comments (6)

mvaligursky avatar mvaligursky commented on May 29, 2024 1

Yep fully agreed, we discussed this and few similar material parameters before. Same for tinting parameters, and likely some others.

from engine.

lucaheft avatar lucaheft commented on May 29, 2024

Is this on the agenda for some of the next releases? This is bugging us for quite a while.

Or maybe you are open for a PR for this. I had quick look in the standard-material-options-builder.js and it should be a pretty straight forward change. But I'm still not too knowledgeable on the rendering part of the engine.
I also get it if you want a complete PR which includes all the changes on this topic, instead of only opacity and emissive tint.

from engine.

Maksims avatar Maksims commented on May 29, 2024

Is this on the agenda for some of the next releases? This is bugging us for quite a while.

Or maybe you are open for a PR for this. I had quick look in the standard-material-options-builder.js and it should be a pretty straight forward change. But I'm still not too knowledgeable on the rendering part of the engine. I also get it if you want a complete PR which includes all the changes on this topic, instead of only opacity and emissive tint.

As a temporary workaround you can use: material.setProperty('material_opacity', opacity) material.setParameter('material_opacity', opacity), which avoids shader recompilation.

from engine.

lucaheft avatar lucaheft commented on May 29, 2024

setProperty does not seem to be a function of material.
There is setParameter, but it doesn't prevent shader recompilation.
The only workaround I found so far is to set max opacity to 0.999 to prevent shader compilation.

from engine.

willeastcott avatar willeastcott commented on May 29, 2024

@lucaheft PRs are always welcome! 🙏

from engine.

Maksims avatar Maksims commented on May 29, 2024

setProperty does not seem to be a function of material. There is setParameter, but it doesn't prevent shader recompilation. The only workaround I found so far is to set max opacity to 0.999 to prevent shader compilation.

setParameter - yes, you are right.
But it does not trigger re-compilation. It does not mark the material to recompile shader (dirty flag on material). It is the most efficient way to set uniform. You can also do it for mesh instance btw.

from engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.