Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: Meka Games on April 13, 2018, 04:44:03 AM
-
Hello. I want to add a Shader Quality setting to my game. For this, i should change the Shader Tier from "Edit>Project Settings>Graphics"
This is actually something that is done automatically by unity but I still want to add it as a setting on the options menu.
https://docs.unity3d.com/ScriptReference/Graphics-activeTier.html
Thanks.
-
Ok I created a script myself. Works great.
using UnityEngine;
using System;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("QualitySettings")]
[Tooltip("Shader hardware tier classification for current device.")]
public class SetGlobalShaderHardwareTier2 : FsmStateAction
{
public override void OnEnter()
{
UnityEngine.Shader.globalShaderHardwareTier = UnityEngine.Rendering.ShaderHardwareTier.Tier2;
Finish();
}
}
}
-
Hi.
Thanks for sharing the script :)
I tested it but i got some obselete warnigs so i rewrote the script.
i also set an enum so you could select the other tiers :
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// keywords : shader quality , shaderquality , globalShaderHardwareTier , ShaderHardwareTier
using UnityEngine;
using System;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("QualitySettings")]
[Tooltip("Shader hardware tier classification for current device.")]
public class SetGraphicsActiveTier : FsmStateAction
{
[Tooltip("The torque forceMode")]
[ObjectType(typeof(UnityEngine.Rendering.GraphicsTier))]
public FsmEnum tier;
public override void OnEnter()
{
Graphics.activeTier = (UnityEngine.Rendering.GraphicsTier)tier.Value;
Finish();
}
}
}
I also gave a different name and added it to the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Could you test if it works?
Search for : Set Graphics Active Tier
-
Hi.
Thanks for sharing the script :)
I tested it but i got some obselete warnigs so i rewrote the script.
i also set an enum so you could select the other tiers :
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// keywords : shader quality , shaderquality , globalShaderHardwareTier , ShaderHardwareTier
using UnityEngine;
using System;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("QualitySettings")]
[Tooltip("Shader hardware tier classification for current device.")]
public class SetGraphicsActiveTier : FsmStateAction
{
[Tooltip("The torque forceMode")]
[ObjectType(typeof(UnityEngine.Rendering.GraphicsTier))]
public FsmEnum tier;
public override void OnEnter()
{
Graphics.activeTier = (UnityEngine.Rendering.GraphicsTier)tier.Value;
Finish();
}
}
}
I also gave a different name and added it to the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Could you test if it works?
Search for : Set Graphics Active Tier
Thanks, its working great and better script!
-
Hi.
Thanks for testing !
Don't stop making actions when needed and post it here, it can always benefit someone :)
and the more you play around with the scripts the easier it gets :)
also feel free to ask, if you get stuck :D
-
Hi.
Thanks for testing !
Don't stop making actions when needed and post it here, it can always benefit someone :)
and the more you play around with the scripts the easier it gets :)
also feel free to ask, if you get stuck :D
Hey djaydino,
This thing is working great on Editor. But when I build my game, it's not working.
Do you know why?
I really want to change the shader quality on the options menu. This leads to more optimization.
Thanks!
-
Hi.
Did you try also with your action?
What platform are you building to?
I got a feeling that this only works in the editor.
As i can only find editor scripts for them.
Maybe you need to look in quality settings, there are some quality actions on the Ecosystem.
-
Hi.
Did you try also with your action?
What platform are you building to?
I got a feeling that this only works in the editor.
As i can only find editor scripts for them.
Maybe you need to look in quality settings, there are some quality actions on the Ecosystem.
My build target is Windows PC.
I also tried with my action.
...It seems so.
I hope someone can answer this question.
-
Hi.
I went on GDL Discord channel and they confirmed it,
Maybe Shader LOD can help?
https://docs.unity3d.com/Manual/SL-ShaderLOD.html
-
Hi.
I went on GDL Discord channel and they confirmed it,
Maybe Shader LOD can help?
https://docs.unity3d.com/Manual/SL-ShaderLOD.html
Alright! Thanks.
Here's my script:
using UnityEngine;
using System;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("QualitySettings")]
[Tooltip("Shader LOD level for all shaders.")]
public class SetGlobalMaximumLOD : FsmStateAction
{
[RequiredField]
[Tooltip("")]
public FsmInt amount;
public override void Reset()
{
amount = null;
}
public override void OnEnter()
{
UnityEngine.Shader.globalMaximumLOD = (amount.Value);
Finish();
}
}
}
-
Does this action still works? I can't seem to find it on the Ecosystem.
-
Hi.
They might not be on the Ecosystem.
But you can create a c# script and copy paste the code.
give the script the same name as the Class name, so its easier to find (SetGlobalMaximumLOD in this case)
I have set a bookmark so i can add to the ecosystem when i have time :)