Home 3D Art Showcase & Critiques

[WIP]Shader Studio - An Advanced Surface + Fragment Shader Graph/Visualiser

vYVC3tP.png
Shader Studio is a new (WIP) Unity editor extension that I am developing. It's purpose is to enable users to create custom shaders without the need to write any code through the visualization of a node-based graph. I have been developing it for a couple of weeks now and wanted to share what I have so far with others to both make people aware of this project and to get feedback and ideas from the community. At the moment it has progressed (in my opinion) extremely well and is continuing to grow daily. There are currently no plans to release the extension for free once it is done, however I do plan at some point to release a free demo that has a graph users can interact with to get an understanding of how the core of this extension works.

At current Shader Studio only compiles surface shaders, it does however contain functional Surface, Vertex, Forward (Lighting), Deferred (Lighting) and Final Color graphs. Through these graphs and the various settings a user is able to take (almost) full control of a surface shader to achieve the desired result.

User Interface:
The bulk of the user interface in Shader Studio is contained within "floating windows", which are as their name suggests windows that are able to be re-positioned, re-sized, anchored, minimized or completely disabled altogether. The aim of this system is mainly to maximize the amount of screen space that is available for the shader graphs, but also allows a user to completely re-organize the UI to their liking.

The properties window is a core element of Shader Studio, inside this window you control all of the properties/inputs of the shader you are making. You are able to give each property a custom variable name, description and default value. You can also re-arrange properties or remove them completely.
The preview window is quite self-explanatory, with some extra capabilities added in: You can toggle whether or not to render the preview in deferred lighting (pro-only), using the time toolbar you have complete control over the time within the preview render and you can also save a preview render to file with the click of a button. As Shader Studio is oriented around the use of properties to control a shader any values you change within the properties window or textures you change within the graph will be instantly applied to the preview window.
The shader settings window allows you to change the name of your shader, set a fallback shader, change the target shader model as well as set an exclude pass.
The queue and blending window allows you to customise the order of which your shader renders objects as well as how it blends.
The culling and depth window allows you to control how the shader decides whether or not to render an object using both z-testing and alpha-testing. You may also set the alpha testing value to be a property value.
The fog settings window allows you to set override fog values for the shader, the fog color, density, near and far values may also be attached to shader properties.
The light settings window contains toggles for optional surface shader inputs that alter the lighting as listed here.
The nodes window contains a searchable list of all available nodes for the current graph. Clicking on any of the buttons will spawn a new node in the middle of the screen, though this can also be done by right clicking on the graph itself and selecting a node.

There are currently over 70 nodes available for surface shaders. Vertex/Fragment shaders currently have limited node support.

Other Notable Features:
- Main Menu: Allows quick access to creating new and loading old(or auto-saved) projects, as well as quick preferences access.
- Vertex/Fragment can now be made using SS, although at current the node support for doing lighting calculations inside them does not exist.
- Multiple Passes - This is a big one, you can now attach as many vertex/fragment passes to a single project as you desire and up to 1 surface shader.
- Groups of nodes can now be exported from graphs and imported into other graphs/projects (providing that the group doesn't contain nodes unusable in the graph you are importing to)
- Optional mouse glow around cursor on lines of grid. This feature was just a bit of fun, you can change the color and size or disable it if you wish.
- Optimized & Organised compiler outputs, the Shader Studio compiler will only define a new
temporary variable if it needs to, formats all code with proper indenting and will optimize
out any unused nodes that have a fallback.
- Custom lighting models can be created using the Forward and Deferred graphs respectively.
- Ability to create vertex and final color functions using the Vertex and Final Color graphs.
- The output flow of graphs can be changed to flow from left to right.
- Naming of inputs and outputs can be customized between RGBA (as Vec2-4), RGBA, XYZW or UVST.
- Math nodes (+ - * /) have an auto-adapting amount of inputs, allowing you to plug
as many outputs as you desire into one math node.
- Easy, in-node swizzling of values allows you to easily add new, remove old and replace existing
outputs on a node to meet the requirements multiple nodes with a couple of clicks.
- You may individually select nodes, click and drag to select or double click a node to
also select every node in it's input chain. Holding control while doing any of the aforementioned
tasks will apply the new selection(or deselection) on top of existing selected nodes.
- When attempting to create a new node connection all possible connectors you establish
a new connection with a highlighted green to help speed up the process of connecting a graph.
- A selected node and any selected nodes in it's input chain can be automatically sorted (stand-in)

Planned Features:
- The ability to create, edit and remove custom "Output Masks". Output Masks are what decides which values of an output are given into an input, so for example an output mask of RRRA would take the R component of an output and use it for the G and B slots as well when used as an input. At the moment only the default built in output masks can be used.
- The ability to create custom function graphs, which once filled can be used as a custom node in all other graphs. They will be able to have any amount of inputs will only have a single output.
- Instruction, Sample, Line and Node count indicators.
- Ability to use 'clip' function within surface functions.
- Ability to customize target renderers
- Images displayed inside nodes visualizing the result they have in the shader. (Where possible)

7mKPu2M.png
Just a simple screenshot of the main menu, the blue highlight on the grid follows the mouse.
SyldKMV.png
This is an example graph that takes in a diffuse, normal and cube map and adds colored fresnel to the edges. (As seen below)
4J7R6lk.png
This screenshot shows what the main interfaces that can be used to change shader settings and preview results look like.
JDBHaJw.png
Showing the compiler output for a simple Bumped Diffuse/Reflection shader.
SMPn1ti.png8ftpS0r.png

At the moment there is no download available, sorry!

All feedback, ideas and questions are welcomed(encouraged). Especially questions regarding things I may not have thought about!

Replies

Sign In or Register to comment.