ShaderForge | A Shader Editor for Unity | Game Engine library
kandi X-RAY | ShaderForge Summary
kandi X-RAY | ShaderForge Summary
I will occasionally update this repository with fixes and features! I'll mostly do compatibility updates for future versions of Unity whenever I need it. if you want older versions, consider pulling one of the older branches! I'll try to name branches helpfully. the oldest version of SF you can get is for Unity 5.x.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ShaderForge
ShaderForge Key Features
ShaderForge Examples and Code Snippets
Community Discussions
Trending Discussions on ShaderForge
QUESTION
I have a method that takes any object as an argument and it should go through the properties, whatevery they are. I'm trying to get properties for a custom shader (created with ShaderForge). This is the method:
...ANSWER
Answered 2018-Jan-04 at 20:49UnityEditor class has ShaderUtil, which contains the following methods:
GetPropertyCount - Get the number of properties in Shader s.
GetPropertyDescription - Get the description of the shader propery at index propertyIdx of Shader s.
- GetPropertyName - Get the name of the shader propery at index propertyIdx of Shader s.
- GetPropertyType - Get the ShaderProperyType of the shader propery at index propertyIdx of Shader s.
- GetRangeLimits - Get Limits for a range property at index propertyIdx of Shader s.
- GetTexDim - Gets texture dimension of a shader property.
- IsShaderPropertyHidden - Is the shader propery at index propertyIdx of Shader s hidden?
To use it, you include "using UnityEditor" in your script and then access it by typing ShaderUtil.(methodname).
With these methods you can iterate through the custom shader properties. It's weird that you can't do this with GetProperties like you do on types, but this worked for me.
The type RANGE was a mystery to me, but what it does is it returns a float value of the actual value and ALSO the min and max values of the parameter so you know what its range is (because it's not a known type).
Please note that this is only for editor, so you have to use conditional #if XXXXX conditions around it, because UnityEditor class and this method won't work runtime.
Unity documentation on ShaderUtil: https://docs.unity3d.com/ScriptReference/ShaderUtil.html
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ShaderForge
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page