Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

trying to change emission scale through script- error

I am trying to change the emission scale (brightness value) from 1-0 in Unity through a script. I have defined different materials with 1, 0.75, ...0 brightness and kept them as child parts of this gameobject called 'Hologram'. On select method is called and the brightness value should be taken up by the 'targetObject' in a similar way as done for Color. But, I cannot find an analogous way of transferring the emission value. I tried using the way as suggested in this link https://answers.unity.com/questions/914923/standard-shader-emission-control-via-script.html, but that is throwing an error. Does anyone know how to solve this?


Answers

  • Options
    JayZuoJayZuo mod
    edited April 2018

    Hi @MadamM,

    I'm not familiar with emission or shader. But according to this question, you can only use "_EmissionColor".

    The shader only uses "_EmissionColor". So you want to multiply the color with it. Effectively you have to pass an HDR color to it.

    Right now there are 3 properties. _EmissionScaleUI & _EmissionColorUI are only used to store data for the UI in the inspector. As the name implies. If you do this at runtime then you can simply ignore _EmissionScaleUI & _EmissionColorUI.

    Properties with the UI postfix in the name are just used to make the UI nicer when a custom material editor is used (e.g. for the Standard shader). What is actually used in the shader is e.g. "_EmissionColor".

Sign In or Register to comment.