Merge pull request #84 from mlavik1/UpdateMaaterialPropertiesFix
Call UpdateMaaterialProperties after enabling/disabling lighting.
This commit is contained in:
Коммит
a88bbbe9a6
|
@ -76,9 +76,13 @@ namespace UnityVolumeRendering
|
|||
return lightingEnabled;
|
||||
}
|
||||
|
||||
public void SetLightingEnabled(bool enable)
|
||||
{
|
||||
lightingEnabled = enable;
|
||||
public void SetLightingEnabled(bool enable)
|
||||
{
|
||||
if (enable != lightingEnabled)
|
||||
{
|
||||
lightingEnabled = enable;
|
||||
UpdateMaaterialProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVisibilityWindow(float min, float max)
|
||||
|
@ -88,8 +92,11 @@ namespace UnityVolumeRendering
|
|||
|
||||
public void SetVisibilityWindow(Vector2 window)
|
||||
{
|
||||
visibilityWindow = window;
|
||||
UpdateMaaterialProperties();
|
||||
if (window != visibilityWindow)
|
||||
{
|
||||
visibilityWindow = window;
|
||||
UpdateMaaterialProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 GetVisibilityWindow()
|
||||
|
@ -113,11 +120,11 @@ namespace UnityVolumeRendering
|
|||
meshRenderer.sharedMaterial.DisableKeyword("TF2D_ON");
|
||||
}
|
||||
|
||||
if(lightingEnabled)
|
||||
meshRenderer.sharedMaterial.EnableKeyword("LIGHTING_ON");
|
||||
if(lightingEnabled)
|
||||
meshRenderer.sharedMaterial.EnableKeyword("LIGHTING_ON");
|
||||
else
|
||||
meshRenderer.sharedMaterial.DisableKeyword("LIGHTING_ON");
|
||||
|
||||
meshRenderer.sharedMaterial.DisableKeyword("LIGHTING_ON");
|
||||
|
||||
switch (renderMode)
|
||||
{
|
||||
case RenderMode.DirectVolumeRendering:
|
||||
|
|
Загрузка…
Ссылка в новой задаче