[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

[SoC 2008] Artist friendly material and shader editor

Post by skatehead »

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?
ImageImageImageImage
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

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.
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
x 76

Post by Assaf Raman »

@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)?
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
x 22

Post by xavier »

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.
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
x 76

Post by Assaf Raman »

@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.
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
x 22

Post by xavier »

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).
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
x 76

Post by Assaf Raman »

@xavier: Do you know any general-purpose tool that also support fixedFunc materials export?
Watch out for my OGRE related tweets here.
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

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
ImageImageImageImage
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

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.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

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.
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: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

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
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 »

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.
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
x 22

Post by xavier »

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
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
x 76

Post by Assaf Raman »

@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.
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
x 76

Post by Assaf Raman »

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.
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
x 22

Post by xavier »

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.
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
x 76

Post by Assaf Raman »

This has full source - not like FXComposer2.
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
x 22

Post by xavier »

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?
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 »

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 :)
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 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.
User avatar
skatehead
Halfling
Posts: 83
Joined: Tue Mar 07, 2006 2:53 pm
Location: Australia

Post by skatehead »

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.
ImageImageImageImage
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 »

@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).
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
x 3
Contact:

Post by Praetor »

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.
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 »

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.
Post Reply