[SoC 2008] Artist friendly material and shader editor

Threads related to Google Summer of Code
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

Thanks guys,

@Asaaf Raman: I have used Mental Mill briefly and UE3 briefly, I’ll have a closer look at some of the other tools when I get a chance, and write up some sort of comparison.

@Praetor: Good idea, I didn’t consider that CG was practically the same as HLSL, shouldn’t be a problem.

@Tuan Kuranes: My idea was basically to expose all the functionality of a material script via a hierarchy of materials, techniques and passes, each with their attributes modifiable in a panel when selected (basically an automated way of using a GUI to create material scripts), and the shader builder would automatically write shader program definitions and include shader parameters as needed.

I see your point that while this might be a lot easier than writing material scripts, it's not really the ultimate solution for people with no knowledge of materials or shaders.

The problem is that the editor makes no assumptions about the application, so all this functionality that the aforementioned user won't know what to do with, is forced on them (like lights per pass, passes for different light types, etc).

Unreal Engine 3 for example doesn't have this problem, because the shader editor only takes certain parameters (diffuse, normal, spec, emissive, etc) as output, and handles everything else internally, not giving you complete control as the material system in Ogre does.

One possible solution would be to keep the current design, but add the ability for programmers to set up their own templates to give to their artists to use, so the artists will only have to use the node based editor. They would open the template and have something like the PreviewMatieral_1 box in this screenshot of UE3:
Image
Then all the artist would have to do, is set up their textures, link their own nodes up to the normal, diffuse, and whatever else the programmer set up, and be done.
e.g. The artist would be presented with this to do with as they please:
Image

The programmer could choose to create a template in the editor and define a list of parameters and their types.
Then they would go about creating a material in the editor to their liking, set it up as they need for their application, and create the shaders using named template nodes in the place of the actual normal, diffuse, etc parameters.
e.g.:
Image
While these images don’t appear to change much from the previous image I posted, hopefully it shows the idea of using templates and what you could potentially do with them.

This adds quite a bit to an already ambitious project, so perhaps if people think this is a good idea, I could just create the node based shader editor for GSoC with support for templates via .material scripts and using the node based editor to set up each pass.

Let me know if anything doesn't make sense.

I already submitted my application, but the idea is still very open to discussion, I put a link to this thread in the ‘Link to Further Information’ box, so I’d love to discuss this with any of the mentors, or any Ogre users with an opinion. I’m on the Ogre IRC when I’m not sleeping, and you can get my IM/email info from my profile, otherwise we can continue the discussion slowly in this thread. (:

Cheers,
-Matt
ImageImageImageImage
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Unreal Engine 3 for example doesn't have this problem, because the shader editor only takes certain parameters (diffuse, normal, spec, emissive, etc) as output, and handles everything else internally, not giving you complete control as the material system in Ogre does.
That's my point.
Complete control over shader and material should stay hidden to the tool's final end-users.
Complete control over the material system would only lead to exponential complexity in terms of Usability... and therefore perhaps being less interesting that handling material/shader by hand.

Did you have a look at template and latest scripting material capabilities ?
This adds quite a bit to an already ambitious project
Actually I proposed a shift as it removes all the shader/material creation part as it focus on template instantiation/tweaking of already done material/shaders.

Even with a node based interface, shader making needs underlying 3D understanding.

Being a long time ogre forum reading, very few people writes shaders, or try to edit them with tools like composer, mental, rendermonkey... but many, many try to just export and/or reuses already done shaders. (Have a look at Monster shader and other successfull shaders code) and many/many material/shader library requests in forums.

Hence the template library idea, which really can suits a lot of situation, specially if tweakable with a nice tool.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

tuan kuranes wrote: Complete control over shader and material should stay hidden to the tool's final end-users.
Here is an idea - Keep it in the format you save it and don't export to CG or HLSL or GLSL - write a runtime component that turns that format to a shader in real time - this way - you will be able to use the same file and just select the language it will generate - as a parameter of the runtime component.
In the tool you don't see the language, so why to save in an shader language - this should be done only at runtime.
Watch out for my OGRE related tweets here.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

The way ShaderFX works, it has several default material type with a set of base variables:

Standard Material:
Ambient color
Diffuse color
Specular color
Specular Level
Glossiness
Self illumination
Opacity
Normal

The Standard material is the simplest for artists taking care of much of the setup for you, whilst advanced only has SinglePass, Multipass, Alpha and you have to build up all the components that make a shader from scratch.

There are other basic material types too:

Subsurface
Fur
Glow
Pixel Shader 1 (for basic PS1.0 shaders) ShaderFX supports 1 - 3

I found shaderFX the most fun and intuitive to use, but to test it you will need to have 3dsmax, or at least use the 3dsmax demo since ShaderFX is a 3dsmax plugin.

There are videos that demonstate how it works at:

http://lumonixsoftware.com/shaderfx_videos.html

if thats of any use.
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

@Tuan Kuranes:
That's my point.
Understood.
I do agree that hiding unnecessary functionality from the end-user is the way to go, i.e. creating materials by modifying presets or using templates, but I think providing a way for programmers to create their own templates, or extend existing ones would make the tool much more valuable to a wider range of users.
Actually I proposed a shift
Yep, I meant my idea of adding templates on top of the existing idea, and I agree that moving in the direction of a tool to edit/extend templates might be the way to go.
Being a long time ogre forum reading, very few people writes shaders, or try to edit them with tools like composer, mental, rendermonkey...
This is my main motivation for wanting to create the tool, hopefully we can come up with something powerful and flexible that people will be willing to use. (And thanks for the links.)
If the templates could be made so a material could be derived by just setting the textures to use (but still let the artist build on it if they needed to), do you think people would use that?

@Assaf Raman: I was thinking that the HLSL, GLSL and CG could just be put in different techniques (Maybe use unified program definitions for GLSL/HLSL and CG as a fallback technique?) , since all the material and program scripts will be automatically generated, the end-user won’t have to deal with any of this anyway.
What are peoples thoughts on the different shader languages? Is there any need to support CG if GLSL and HLSL are both supported?

@Evak: Thanks for the link, I watched a bunch of the videos, and this looks like a good approach, pretty similar to what I would like to do, but rather than only having presets, also allow programmers to create their own (from scratch or by extending existing ones), so they can support their own lighting and shadowing setups if they like, and do whatever else they want.

Thanks for all the input everyone, I think we might be on to something here. (:

Cheers,
-Matt
ImageImageImageImage
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

If the templates could be made so a material could be derived by just setting the textures to use (but still let the artist build on it if they needed to), do you think people would use that?
Totally sure, but you should/can have a poll in forums.

That's the main use of material templates in Ogre as it actually exists, and current Ogre project should really only works like that. Defining a few templates (basic/skeletal/pose/transparent) per project is the way to go. All other materials are just inheriting those few ones.

Now, you can propose "Template material inheritance building" as part as another gsoc application.
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

Thanks Tuan,
I'll get right on it. (:
ImageImageImageImage
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

I've submitted the new application, and I've pasted it here for anyone other than mentors who might like to comment on it, or just read it.

Any feedback will be greatly appreciated.
Cheers,
-Matt

Abstract:
Being able to easily create and test materials and shaders is very important for any rendering engine. Ogre has a very powerful and robust material system, but it requires writing scripts and shaders manually. This project aims to create a tool that artists can use to easily create materials and shaders directly for their Ogre applications by using material templates. The tool will combine a simple node-based editor for deriving Ogre materials and shaders from existing templates, and a system for programmers to create their own application specific templates. The node-based editor will be similar to those found in commercial game engines such as Unreal Engine 3 and Offset Engine.


Proposal:
This proposal is to create a node-based shader editor for Ogre that will greatly simplify the process of creating materials and shaders for artists by allowing them to create new materials by building on existing templates. The editor will maintain the flexibility and robustness of Ogres material system by allowing programmers and experienced artists to create their own templates (or modify/extend existing ones) to suit their application specific needs.
To create a material template, the users will write a material script to base the template on, including necessary techniques and passes. Then load the material as a new template, and for each pass, create either a shader template using the node-based editor, or a fixed function template.
An example of a shader template being created:
http://img374.imageshack.us/img374/1540 ... exteq5.png
And an artist building a simple material off this template:
http://img382.imageshack.us/img382/6908 ... extfl5.png


Motivation:
I want to see more Ogre projects taking full advantage of the capabilities of current hardware, and to provide an easier way for developers to do so.


Goals:

-To create a material editor for Ogre capable of building complex material effects from templates using a GUI based editor.
-To give the artist constant and immediate feedback via a real-time 3d preview window when creating materials.
-To give programmers a way to build application specific templates for artists to use.
-To create a node-based shader builder that is easy to use and generates efficient shader code.


Relevant experience:
-Experience using Ogre.
-Experience using wxWidgets.
-2+ years using C++.
-Experience using DirectX and HLSL.
-Solid understanding of advanced rendering techniques and shaders.
-Solid understanding of Ogre material system.
-Worked with open source project Box2D, porting the C++ library to ActionScript 3. ( http://box2dflash.sourceforge.net )
-Screenshots of graphics programming work linked below:

(Created in C++ using DirectX and HLSL)
http://img229.imageshack.us/img229/3784 ... 006cb9.jpg
http://img404.imageshack.us/img404/7209 ... 007nf8.jpg
http://img170.imageshack.us/img170/5498 ... 127ha1.jpg
http://img296.imageshack.us/img296/3873 ... 071ki9.jpg
http://img170.imageshack.us/img170/1690 ... 072lf1.jpg
http://img292.imageshack.us/img292/5378 ... 075gy4.jpg
http://img245.imageshack.us/img245/2408 ... 077xu4.jpg
http://img237.imageshack.us/img237/3220 ... 080jn0.jpg
http://img185.imageshack.us/img185/4982 ... 082hv4.jpg


Timeline (Approx dates):

April 14 - April 21:
-Experiment with wxWidgets to determine how it can be used most effectively to produce the desired result.

April 22 - May 26:
-Plan specific details for all features to be implemented.
-Begin working on framework for editor to be built on.

May 26 - June 5:
-Develop material template system and derived material exporter.

June 6 - June 15:
-Develop GUI for creating templates/deriving materials.

June 16 - June 25:
-Develop node-based shader builder framework and CG exporter.
-Add basic 3d preview window (Using wxOgreRenderWindow).

June 26 - July 7:
-Develop GUI for shader editor.
-Submit mid-term evaluation.

July 8 - July 15:
-Build on functionality of shader builder (add remaining intrinsic functions as nodes).

July 16 - July 25:
-Extend 3d preview to allow loading custom meshes.
-Add texture thumbnail to texture samplers.

July 26 - August 11:
-Complete any remaining tasks that took longer than anticipated.
-Write documentation.
-Make video tutorials.
-Work on aesthetics of GUI if time permits

August 12 - August 18:
-Test thoroughly for bugs, tidy up, etc.


Future work:
-Support HLSL/GLSL shaders.
-Add more templates based on community feedback.
-Add features based on community feedback.
-Extend the editor to allow material templates to be created completely from scratch using a simple GUI (I.e. without any existing .material file.
-Add diagrams and mouse over explanations to shader functions to help artists understand what the function does.

Contact:
I can be contacted via the Ogre forums under the username ‘skatehead’, or on the Ogre IRC, or at (email address in profile) or on MSN using the same email address. Please let me know if you would like more information, or would like to discuss the idea.
ImageImageImageImage
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Post by Brocan »

I see that your project wasn't accepted, are you planing to develop by yourself? :)
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

No plans at the moment, very busy with a freelance flash programming job, labouring work, and other financially oriented personal projects.

It's something I would really like to do though, if I didn't have to pay bills or buy food I would certainly be working on it. (:
ImageImageImageImage
redhead
Kobold
Posts: 37
Joined: Sun Jun 01, 2008 4:25 pm

Re: [SoC 2008] Artist friendly material and shader editor

Post by redhead »

Hi
is there any progress of making this editor? I have to say it is really wonderful looking program.
I hope you didnt give up :)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [SoC 2008] Artist friendly material and shader editor

Post by jacmoe »

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
redhead
Kobold
Posts: 37
Joined: Sun Jun 01, 2008 4:25 pm

Re: [SoC 2008] Artist friendly material and shader editor

Post by redhead »

yeah, but it looks different, it is code based, isnt it? I thought it will be something like the nodes and connecting things like in this thread's editor..
thanks anyway
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [SoC 2008] Artist friendly material and shader editor

Post by jacmoe »

redhead wrote:yeah, but it looks different, it is code based, isnt it? I thought it will be something like the nodes and connecting things like in this thread's editor..
thanks anyway
Those images are from the UE3 editor. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
nickG
Greenskin
Posts: 122
Joined: Fri Jan 20, 2012 6:44 pm
Location: Russia,Moscow
x 1

Re: [SoC 2008] Artist friendly material and shader editor

Post by nickG »

somebody tryed make similar?
Post Reply