[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
Contact:

[SoC 2008] Artist friendly material and shader editor

Post by skatehead » Tue Mar 18, 2008 8:54 pm

Hi,

I'm very interested in creating an artist friendly material/shader editor for Ogre, similar to the ones found in UE3, Offset Engine, etc.

E.g (Offset Engine)
Image
(click for full size)

The idea is to create a node based material editor that an artist could use to create materials from scratch, or modify presets, using a simple gui and a real-time preview to provide constant feedback.
The editor would automatically generate .material files as well as hlsl/cg/glsl code, ready for use in Ogre applications.

Specific implementation details aside, is there much interest in such a tool for Ogre?
0 x
ImageImageImageImage

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Tue Mar 18, 2008 8:56 pm

This would probably be a continuation of last year's Material Editor project?

I would also suggest that the whole thing is a bit ambitious -- you might want to think about the editor roadmap a bit and figure out what actually could be done over a summer.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Tue Mar 18, 2008 9:10 pm

@skatehead: Have a look at "mental mill (TM) Artist Edition" that comes with FX Composer 2.
Image
Will a converter from that tool output will have the same results as your project idea? In what your idea differ from that tool(except from the output)?
0 x
Watch out for my OGRE related tweets here.

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Tue Mar 18, 2008 9:16 pm

I ran into this same issue with OgreCollada. Ogre's material system is far more robust than any general-purpose tool. For example, the sheer number of different ways you can combine texture units in Ogre's material system outpaces anything that existing external tools can support. At some point, you end up having to write custom tools for your engine -- the "existing ones + exporter" can't support everything the engine does.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Tue Mar 18, 2008 9:34 pm

@xavier: Basically - I agree, but an exporter\converter is a small project that he can finish in the summer and I think that a tool like "mental mill (TM) Artist Edition" is too much work for a single summer.
Regarding the "sheer number of different ways you can combine texture units in Ogre's material system" – well – I think you can add new shaders to "mental mill (TM) Artist Edition" and if that is true then you can do any of the combine texture units that OGRE has in that tool. What you can’t do with the tool is real FixedFunc – it is only a shader tool.
0 x
Watch out for my OGRE related tweets here.

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Wed Mar 19, 2008 1:27 am

Assaf Raman wrote:What you can’t do with the tool is real FixedFunc – it is only a shader tool.
And that is the problem -- a significant percentage of Ogre apps need to run on non- or limited-programmable systems. Not that an exporter for Mental Mill is a bad thing -- but if it's just programmable, then COLLADA already suffices for that (and Mental Mill, FXComposer, xnormal, and any number of DCC tools already support COLLADA).
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Wed Mar 19, 2008 7:38 am

@xavier: Do you know any general-purpose tool that also support fixedFunc materials export?
0 x
Watch out for my OGRE related tweets here.

User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia
Contact:

Post by skatehead » Wed Mar 19, 2008 1:12 pm

Thanks for the replies,

xavier: My intention would be to start the tool from scratch.
I understand that it's ambitious, but I think it is absolutely achievable in some form. The initial scope could be reduced quite a bit to still create a useful tool, and leave some features to 'if I have time', or after GSoC.

Assaf Raman: Thanks for the link, while this could work, I think a standalone tool that is very tightly coupled (in a good way) with Ogre's material system would be far more valuable to the community than a converter from another program.

I'll write up a more specific plan of what I'd like to do when I get a chance.

Cheers,
-Matt
0 x
ImageImageImageImage

User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
Contact:

Post by Evak » Wed Mar 19, 2008 3:29 pm

I'm currently using Ofusion Pro with ShaderFX bridge, thats awesome and makes Ogre shaders directly. ShaderFX by lumonix is worth looking at as another based node shader editor.

At the end of the day though, I'd be really interested in a good Fx composer to Ogre converter. Or some way to convert .FX files to ogre shaders and materials.

This is simply because there are a number of tools out there for making .FX shaders that artists like me can use, the problem is that getting them into ogre with any success if your not a coder is very tricky and time consuming.

I'm really happy with shaderFX and Ofusion, but you need to have $ to buy 3dsmax, Ofusion, and the ShaderFX plugin for 3dsmax.
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Wed Mar 19, 2008 4:29 pm

Assaf Raman wrote:@xavier: Do you know any general-purpose tool that also support fixedFunc materials export?
No, that's why you pretty much have to code a custom tool from the ground up.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Wed Mar 19, 2008 6:30 pm

I wasn't very impressed with mental mill when I tried it - the shaders produced for even a simple effect (normal mapping) were much more complex & long (even after compilation, eliminating unused features) than I could write by hand. But I guess that's the trade off.

Based on previous SoC tool projects, and with the benefit of hindsight, it's very important to be realistic, because a half-finished tool project isn't that useful unless you either continue with it after the summer or someone else picks it up. This is what happened with last year's material editor - the effort was worthwhile in and of itself, but the end result wasn't usable without more work, and it stagnated after the summer until CaseyB picked it up recently. It's actually better to pick a smaller subject area and complete it in its entirety, or take something that exists already and enhance it in a measurable way that is completable in the time. Everyone tends to be overoptimistic about what they can do in a few weeks, so I think I would only believe that someone could complete an equivalent of say the Unreal3 material editor in the summer if they have considerable experience already, with Ogre, shaders, material systems and the windowing tool libraries they'd be using, because there is a hell of a lot to get done in the time and you really can't afford to hang around. I'd take a fair amount of convincing that a project like this was doable in the time, great though it would be.

I agree that better direct support for transitioning data from FXComposer2 to Ogre is much more doable.
0 x

User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
Contact:

Post by Evak » Wed Mar 19, 2008 6:43 pm

With my last post I Didn't want to put a negative note on your plans, I do think a material editor is a fantastic idea.

I think Sinbad has a very good point too, an editor is only good if its finished and useable and preferably released with a binary version too.

To this day I still havent managed to try out last years material editor project, was disappointed when I heard that it didn't get finished.

I also tried mental mill and wasn't impressed. The first thing I tried to do was create a terrain shader that blended 3 normal map + specular textures using red and green vertex colors in a single pass on my 7800.

There didn't seem to be any way to use vertex colors that I could find in mental mill. ShaderFX I created the shader in a couple of minutes. To be fair I guess shaderFX has the benefit of working directly inside 3dsmax so you can paint with vertex colors and see the results in realtime. But I was disappointed that te first shader I attempted didn't seem to be possible in mental mill.

Good luck with whatever you decide to do.

Here's a screenshot of the ofusion ogre exporter with ShaderFX bridge.


Image
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Thu Mar 20, 2008 9:16 pm

Regarding the thread topic – I think we are mixing 3 ideas:

1. A nice GUI with preview for the OGRE material\technique\pass classes.
2. A ShaderFX\"mental mill (TM) Artist Edition" clone written with OGRE.
3. An exporter\convertor from an existing shader editor.

You can refer in the next posts to the tool type numbering to save the time explaining what tool type you mean.
0 x
Watch out for my OGRE related tweets here.

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Thu Mar 20, 2008 9:38 pm

Assaf Raman wrote:Regarding the thread topic – I think we are mixing 3 ideas:

1. A nice GUI with preview for the OGRE material\technique\pass classes.
2. A ShaderFX"mental mill (TM) Artist Edition" clone written with OGRE.
3. An exporter\convertor from an existing shader editor.

You can refer in the next posts to the tool type numbering to save the time explaining what tool type you mean.
1. continues last year's work on the Material Editor
2. can also continue last year's work on the Material Editor, but won't get done over the course of SoC
3. is simple, but misses over half of the Ogre material system's capabilities, so I personally don't see the value in it
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Thu Mar 20, 2008 9:52 pm

@Xavier: I agree with you completely, the thing is that is seems that skatehead wants to do 2. I guess we will have to wait for his post to see his idea in full to know if it can be done.

@skatehead: The timeline of your plan is one of the important parts.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Sun Mar 23, 2008 12:56 am

Have a look at this site: http://www.typhoonlabs.com/
A nice looking shader designer with full source and LGPL licence, it can be a good base for material editor, can save lots of time.
Image
You can download a setup from here.

You can download the source from here.
0 x
Watch out for my OGRE related tweets here.

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Sun Mar 23, 2008 2:21 am

Hehe they cloned FXComposer2, which is already free. ;)

Furthermore, the guys at nVidia (Kevin Bjorke, anyway) are willing to help add better direct Ogre support via the FXC Python interface.
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Sun Mar 23, 2008 11:53 am

This has full source - not like FXComposer2.
0 x
Watch out for my OGRE related tweets here.

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Post by xavier » Sun Mar 23, 2008 7:23 pm

My point is that the source is great -- but you wouldn't necessarily be changing the source for this. Python scripting in FXComposer *should* allow you to do the same thing you would do with this project in terms of an Ogre material editor. Occam's Razor, and all that.

Regardless, neither have the pretty Mental-Mill-style graph-editing features that the OP seems to want to employ. And since we already have a "Material Editor" base in place from last year, why not build on that instead?
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

pepe
Gnoblar
Posts: 1
Joined: Tue Mar 25, 2008 8:50 am

Post by pepe » Tue Mar 25, 2008 9:10 am

As mentioned previously by xavier, FXComposer2 gives direct access to its internal data through a simple yet powerful python interface that well documented.

There is also a basic plugin API that you can use to extend the interface, add exporters/importers, add new renderdevices... using any .NET language. The plugin API could be used to plug a specialized ogre material editor for example.

Anyhow, using FXC2 or not, that kind of project would be a lot more reasonable to do as a plugin of an existing application rather than from scratch. At least for now.

Happy coding :)
0 x

User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
Contact:

Post by Evak » Tue Mar 25, 2008 4:06 pm

The nice thing about FX composer 2 is that it loads .fx shaders already created in almost all the artist friendly node based tools. Plus it can convert to CG code compatible with GL where all the artists tools only support HLSL.

Metal Mill, and ShaderFX both work with FXcomposer 2, and FX composer 2 has a big advantage over rendermonkey in that you can load .FX files, not just save them.
0 x

User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia
Contact:

Post by skatehead » Tue Mar 25, 2008 8:49 pm

Hey guys, sorry for the late reply, went camping with the family over Easter, came back tired, lots of downtime.

Here's a quick photoshop mockup I did of the layout and basic idea.
Image
Edit: my friend kindly added a sphere to the 3d preview :P

Down the left side is a hierarchy of materials, techniques and passes, which you can create from scratch or load from a .material file.
Selecting a material, technique or pass will bring up all it's properties in the area to the right.
If a pass uses the programmable pipeline, you can either select an existing vertex/fragment program, or create a new shader using the node based shader builder.

I'm working on my application now, I'm pretty confident I can create a useful tool in the given time frame, and I would love to continue working on and supporting the tool after GSoC.

A bit about myself: I have experience with c++, wxWidgets, Ogre, directX, hlsl (cg and glsl versions would come after GSoC), and a good understanding of Ogre's material framework.
I guess you could say I have some experience with open source projects (I ported Box2D from c++ to ActionSctipt 3, which I believe sinbad used when trying out Flash :P).
I am very passionate about real-time rendering and engine programming, and a material editor is something I would really love to do, this is my only GSoC application.

I'm not really interested in writing an exporter/converter, so if the mentors think my proposal is too ambitious, then I'll just be content with what I've learned researching and thinking about this over the last week and go do some labouring work instead. (:

All the best,
-Matt
Last edited by skatehead on Wed Mar 26, 2008 7:36 am, edited 1 time in total.
0 x
ImageImageImageImage

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Post by Assaf Raman » Tue Mar 25, 2008 9:10 pm

@skatehead: Nice mockup.

Can you create a feature matrix comparison table of other tools and your tool? (including Offset Engine, "mental mill (TM) Artist Edition", ShaderFX and other tools if you want).
0 x
Watch out for my OGRE related tweets here.

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Post by Praetor » Tue Mar 25, 2008 10:35 pm

Yeah, please look into Mental Mill. I don't know much about or have much experience with it, but I'd love a good comparison. Also, about the shader stuff, if you are familiar with hlsl then you are familiar with Cg. Given Ogre's x-platform focus would it be too much to ask that the first implementation use Cg instead of hlsl?

And, your mockup is really great.
0 x

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

Post by tuan kuranes » Thu Mar 27, 2008 10:32 am

Can you be more specific on how material will be produced ?
- use of template ?
- advanced scripting use ?
- project management ?

About potential users, either :

- People don't know a thing about shaders and material possibilities :

Then a gsoc projects that would offers a" ready to use shader/material library" along with a customization tool would be far more interesting for users.
User material would just have to inherits from chosen material in library and adapt it. The tool that 'adapt' the shader/material library per project could be the winner here.

- People know shaders, therefore are using template and advanced ogre script system. Ability to fine-tune their own material library is interesting so that artists can have have their word there.

Rather than a very generic and then very hard to use and code, that will be unable to fulfill all needs, I would focus attention on that specific subject, material library + fine tune tool, which would really use Ogre material power capabilities and offer useful tool.
0 x

Post Reply