[Accepted] Ogre Material Editor

Threads related to Google Summer of Code
User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY
Contact:

Post by Hudson » Wed Apr 18, 2007 1:13 am

@Game_Ender

I've been looking at the wxOgre/wxOgreControl entries on the OgreWiki (found here).

If you have any improvements on this I'd love to see them!
0 x

Professor420
Greenskin
Posts: 116
Joined: Fri Jul 28, 2006 9:35 am
Contact:

Post by Professor420 » Wed Apr 18, 2007 1:20 am

I think there are two ways to do this. One, is like FXComposer, Rendermonkey, etc., in that you have a real-time update of the material you are working on. TBH I am amazing Ogre doesn't have one already, but not being a programmer, I can't complain. However, having a decent shader language knowledge and knowing the Ogre material system would be a requirement.

The other, is the Unreal3/Offset node-based GUI material editor. Also, the interface for ShaderFX (www.lumonix.net) is extremely similar, and they have a free trial version if you have 3dsmax. This is harder to do, but more intuitive, but at the end also produces dirtier code you don't have great control over, that would need to be cleaned in the end anyway. If you go this route, I'd suggest speaking to Ben Cloward and Kees, the guys behind ShaderFX, as they can give you some estimate of the work involved with something like that... I think it is quite large, maybe more than this SoC can allot for.

Ideally, I'd like to see both in the same tool, and I think its possible. However, I would call the first version (FXComposer-like) fundamental, though having a node-based sandbox solution would give artists much greater control over Ogre's material system... I've been able to achieve some amazing shaders and visuals with Ogre because both art and shaders. And when artists either learn a shading language, or get tools like Offset Editor/UE3 ed/ShaderFX, graphical fidelity is always going to go up (and framerates down!) because the artist's eye is more adept at what it is materials do (represent a surface).
0 x

User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY
Contact:

Post by Hudson » Wed Apr 18, 2007 2:21 am

@Professor420

I'd really like to see both of these in the same tool. I really like the graphical editor, like the one in ShaderX and other tools listed previously in this thread.

My plan is, as you said, to create the FXComposer/RenderMonkey like interface first; but this will provide me with a good foundation onto which I can later develop the graphical editor on top of.
0 x

User avatar
JustinWalsh
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 209
Joined: Mon Sep 05, 2005 8:11 pm
Location: Phoenix, AZ
Contact:

Post by JustinWalsh » Fri May 04, 2007 1:00 am

I'm really excited about this tool and I wish you the best on getting it going.

I just wanted to pop-in and drop down some suggestions.
- I think if you where to use something like wxScintilla for the text editing, things like auto completion and syntax highlighting will be a breeze.
- It would also be wicked sweet if the highlighters and auto-completions had a plugin architecture, so others could develop the Cg, HLSL, and GLSL highlighters and auto-completion.
- My justification for such a system is that I have yet to find a cross platform environment for shader development, and this application could be the first. Also if you developed the highlighter and auto-completion system as a plugin architecture you would be free to implement the additional features later or the community could pitch in.
0 x

User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 1
Contact:

Post by CaseyB » Fri May 04, 2007 4:33 am

JustinWalsh wrote:I think if you where to use something like wxScintilla for the text editing, things like auto completion and syntax highlighting will be a breeze.
I don't want to steal his thunder, but this is already in the plans!
0 x
Image
Image

redmonk
Kobold
Posts: 39
Joined: Sat Sep 23, 2006 10:09 am

Post by redmonk » Fri May 04, 2007 11:18 am

Maybe this can help you!

Blender 2.43 - Render Passes
http://www.blender.org/development/rele ... er-passes/


Blender 2.43 - Imaging & Playback
http://www.blender.org/development/rele ... 3/imaging/

Image
Image
Image
0 x

User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY
Contact:

Post by Hudson » Fri May 04, 2007 4:17 pm

@JustinWalsh

Yeah I plan on using wxScintilla.

I actually downloaded the source code for Code::Blocks the other day to look at how they handle this. This page gives a pretty good overview of how lexers can be added to Code::Blocks.

The bad news is, looking at wxscintilla.h it appears that none of the shader languages are supported, rendering the Code::Blocks approach inadequate. Which leaves me implementing the lexers the old fashioned way described here.

I haven't spent much time looking into this yet though... the code editors will likely be pretty basic in the beginning, being refined later after much of the other core functionality is in place.
0 x

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Fri May 04, 2007 6:00 pm

[quote="redmonk"]Maybe this can help you!

Blender 2.43 - Render Passes
http://www.blender.org/development/rele ... er-passes/


Blender 2.43 - Imaging & Playback
http://www.blender.org/development/rele ... 3/imaging/
quote]

man, I really like the direction blender is heading. To avoid hijacking the thread can you PM me if blender can/is planning to make the material node editor be able to create game shader code? Like ShaderFX for max (google it, it's cool)
0 x

kcbanner
Goblin
Posts: 208
Joined: Sat May 05, 2007 4:49 pm

Post by kcbanner » Sat May 05, 2007 4:50 pm

FX Composer 2 will support Cg, and be cross platform from the press releases I've read.

Looking forward to it :P
0 x

redmonk
Kobold
Posts: 39
Joined: Sat Sep 23, 2006 10:09 am

Post by redmonk » Mon Jun 04, 2007 9:01 pm

How is the project going?
0 x

User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY
Contact:

Post by Hudson » Fri Jun 08, 2007 11:12 pm

Just a quick update on my progress:

- Completed basic application layout

- Created a custom lexer in Scintilla that supports the syntax coloring of Ogre Material Scripts

- Began developing a lexer in Scintilla that supports the syntax coloring of HLSL/GLSL/Cg

- Began developing a Workspace/Project concept similar to the one found in ATI RenderMonkey


Here is a screen shot: (click for larger image)

Image

I'm beginning to concentrate on work that is more "behind the scenes"... specfically the code handling the interaction between the UI elements and Ogre (the "controller" in MVC).
0 x

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 » Fri Jun 08, 2007 11:39 pm

Very cool. The code editor looks great.
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Post by Kencho » Sat Jun 09, 2007 2:33 am

Praetor wrote:Very cool. The code editor looks great.
Seconded.
0 x
Image

User avatar
inneractive
Gnoblar
Posts: 19
Joined: Sun Jun 03, 2007 2:32 am
Location: Bay Area, California
Contact:

Post by inneractive » Sat Jun 09, 2007 9:11 am

I can't wait to get my hands on this :D
0 x
-Joe

redmonk
Kobold
Posts: 39
Joined: Sat Sep 23, 2006 10:09 am

Post by redmonk » Sat Jun 09, 2007 10:19 pm

It's looking nice and promising, just waiting to see more from you. If you need some testing I gladly help you.
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 Jun 13, 2007 2:53 am

I've been playing with shaderFX and for a non programmer its awesome. It's a shame that I can't get the .FX files into ogre Yet.

The biggest problem for shader creation tools that artists can use, isn't so much creating them, but having to tweak them to work in Ogre, or double tweak them to pass parameters that ofusion can write your material scripts from.

It seems that the most common format is DXSAS, that is slowly being adopted by many engines, its a shame that Ogre isn't one of them.

I'm kind of hoping that a custom solution like this may eventually allow some ways to convert shaders without having to know how to code.
0 x

kcbanner
Goblin
Posts: 208
Joined: Sat May 05, 2007 4:49 pm

Post by kcbanner » Wed Jun 13, 2007 4:49 am

Hey,

If you need any help with CG or CgFX drop me a pm I'll be glad to help :D

-kcbanner
0 x

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 » Wed Jun 13, 2007 6:35 am

Evak wrote: It seems that the most common format is DXSAS, that is slowly being adopted by many engines, its a shame that Ogre isn't one of them.
We are reluctant you adopt anything that can only be implemented in one rendering subsystem. A directx-only solution is not ideal. We like to tackle the problem the other way, make Ogre material system as robust and feature-rich as possible, and provide ways to get your stuff into that format. Obviously that last bit isn't easy. That's why tools like this material editor are so important to the community.
0 x

kcbanner
Goblin
Posts: 208
Joined: Sat May 05, 2007 4:49 pm

Post by kcbanner » Wed Jun 13, 2007 6:56 am

Yeah, we cant tie this to DX at all, that rules out mac/linux!
0 x

Professor420
Greenskin
Posts: 116
Joined: Fri Jul 28, 2006 9:35 am
Contact:

Post by Professor420 » Thu Jun 14, 2007 2:46 am

Evak wrote:I've been playing with shaderFX and for a non programmer its awesome. It's a shame that I can't get the .FX files into ogre Yet.

The biggest problem for shader creation tools that artists can use, isn't so much creating them, but having to tweak them to work in Ogre, or double tweak them to pass parameters that ofusion can write your material scripts from.

It seems that the most common format is DXSAS, that is slowly being adopted by many engines, its a shame that Ogre isn't one of them.

I'm kind of hoping that a custom solution like this may eventually allow some ways to convert shaders without having to know how to code.
http://lumonixsoftware.com/yabb/YaBB.pl?num=1179634232
I just need to actually finish and upload the material and program code. Then I'll add it to the wiki as well.

I'm personally a big fan of Ogre's material system, even though I only use HLSL right now. Its really easy to keep nice and tidy once you get a grip on the pipeline. The only qualm I have is not with the material system, but that if I change a gloss parameter I need to reload my app (ie, a lack of tools). It would be great to do it realtime (think FXComposer), which I think/hope is what this editor is addressing.
0 x

User avatar
Hudson
Halfling
Posts: 60
Joined: Thu Sep 14, 2006 2:46 pm
Location: NY
Contact:

Post by Hudson » Thu Jun 14, 2007 3:13 am

@Professor420

Excellent write up!

Interesting that they save everything as one file, RenderMonkey saves the entire workspace as one file as well.

I've been thinking about how I should handle persistence in this editor. I'm leaning towards saving everything in a Project (projects can contain one or more Materials... similar to RenderMonkey Effect Groups) to a zip file... possibly with the option to pull in all the referenced textures, meshes etc (in case you really wanted to transfer everything easily to another machine and/or send to someone else). The UI would of course allow you to save everything individually as well.
Professor420 wrote: It would be great to do it realtime (think FXComposer), which I think/hope is what this editor is addressing.
Yes that's certainly one of the goals!
0 x

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 » Thu Jun 14, 2007 4:06 am

I think a clear split between "editing" and "real-time use" is a good idea. What I mean by that is that while editing, you can save workspaces, or projects, or whatnot, as a single file somewhere. You can save your work, and the editor is allowed to insert any extra data it needs in order to make the editing experience easier. When you are ready you can export your work for real-time use. This means taking a material from the project and "exporting" it to a material script, or exporting a project wholesale to a directory, where the project's material script, shaders, and texure all appear. Yeah, I'd go with the packaged project file idea.
0 x

User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 1
Contact:

Post by CaseyB » Thu Jun 14, 2007 4:57 pm

Praetor wrote:I think a clear split between "editing" and "real-time use" is a good idea.
I agree, and I think that's what's going to be going on. When you "save" it will save in some internal format and then you can export to an Ogre Material, which will create the appropriate directory structure and everything for use in real-time applications.
0 x
Image
Image

redmonk
Kobold
Posts: 39
Joined: Sat Sep 23, 2006 10:09 am

Post by redmonk » Fri Jun 15, 2007 10:35 pm

FX Composer 2 Beta is out with Mental Mil!

http://developer.nvidia.com/object/fx_c ... _home.html

Image
0 x

randall
Halfling
Posts: 63
Joined: Sun Jan 23, 2005 1:04 pm
Location: Poland

Post by randall » Sat Jun 16, 2007 4:07 pm

Maybe it's better to write plugin for FX Composer 2 than to write whole editor...
0 x

Post Reply