RT shader and Mentalray shader can be combined in a Metashader?

11 views
Skip to first unread message

Stefan Kubicek

unread,
Jun 27, 2008, 11:07:19 AM6/27/08
to X...@softimage.com
Is it possible to combine a phong shader (plus some additional shading
nodes) and a cgFX realtime shader (that references a cgFX file from disk)
in a metashader, which can connect to both software and realtime shading
ports of a material?

What I ultimately want to create is a single shading node that allows 4
textures to be connected to it.
The rest should be handled internally (how they are blended depending on
vertex colors, etc) for both realtime shading and
mental ray rendering.
The artist should not need to worry about the internal network, he should
only connect textures to the ports and see the correct result in the
viewport (when viewport is set to OpenGL) or MentalRay, when rendering.

I know how to create a realtime shader that does that, and similarly a
shading network for MRay,
so the focus is purely on encapsulation here.

Before I embark on that journey, I'd like to figure out if that's even
possible in the first place (mixing RT shading nodes
and software shading nodes in a Metashader.)
From all chapters of the SDK documentation I've read the one covering the
Metashaders
is the most "abstract" one so far.

Cheers,

Stefan

---
Unsubscribe? Mail Majo...@Softimage.COM with the following text in body:
unsubscribe xsi

Stefan Kubicek

unread,
Jul 1, 2008, 11:41:39 AM7/1/08
to X...@softimage.com
It's quite surprising that a usually very active mailing list community
goes silent on seemingly simple topics.
There seem to be some corners of XSI that people just don't know anything
about, at least not those individuals
enrolled in this mailing list.
Is nobody on this list making games, or using realtime shaders in any
context?
Or is nobody using meta shaders?

Not pissed, just curious.

Alan Jones

unread,
Jul 1, 2008, 12:07:00 PM7/1/08
to X...@softimage.com
On Tue, Jul 1, 2008 at 4:55 PM, Raffaele Fragapane
<raffsx...@googlemail.com> wrote:
> Can't think of anybody either, except maybe Guy or Ian, but both have been
> MIA for ages now.

I heard they got rich off their MR/RTS work.....

Not something I've ever bothered with either. Always seemed like a lot
of work. Though I have
been sure to hassle Halfy about new API stuff for the rendertree with
our new fancy rendering
API available. He always loves receiving those emails. Apparently he
likes the scrunching paper
sound his computer makes when they go in the trash. ;)

If the viewport shading could be treating as another renderer then
that would be something that
would certainly start to have coolness appeal. Being able to set a
whole viewport to your choice
of renderer which may be gpu, cluster computing accelerated, hamster
driven or mental ray,
3delight etc would be a very nice step in terms of generalizing XSI's
rendering/viewport stuff. It
could also open some doors as far as custom UI tools etc that we can't
really do yet. Though I'll
hang off on asking for this until they've ditched mainwin and ported us to Qt ;)

Cheers,

Alan.

Raffaele Fragapane

unread,
Jul 1, 2008, 11:55:53 AM7/1/08
to X...@softimage.com
Read about it, never ended up doing anything.
Last time I wrote a MRay shader was years ago, and I've never bothered with rts at all inside 3d apps.


Can't think of anybody either, except maybe Guy or Ian, but both have been MIA for ages now.

Tim Leydecker

unread,
Jul 1, 2008, 12:41:25 PM7/1/08
to X...@softimage.com
I´m not doing anything in games except play some of them.

The RTS thing for me personally would be interesting mostly
for modeling, e.g. bake some nice lighting into a map and
use realtime envAO á la ZBrush for a decent feedback and
look of surfaces while fiddling with yet another crease behind
the ear or another spot on the mesh "never, ever that close".

If there´d be anyone from Softimage willing to touch the
current viewport display/feedback, I´d hope they´d first
get into adding more elaborate lighting tools and options,
make sure any surface can emit light and one actually can
see something when using lights with intensity/color >1.

Not to forget a realtime capable lensshader, mR having
textures with a better default than "is gamma 1" and
likely someone who checks every setting twice before release.

Once the above would be done, the closest I would want to
get to RTS would be V-Ray Realtime, e.g. see final imagequality
in the viewport (given enough horsepower).

By then we probably have 128cores/box anyway and only intel is left.
(Along with google, Microsoft and Yahoo, Yahoo in a corner).

So much for my early friday post.

Cheers

tim

P.S: It seems I´m the only one of this list who´s not a part
of the XSI betagroup, it´s so quiet here, lately...

Raffaele Fragapane

unread,
Jul 1, 2008, 12:44:02 PM7/1/08
to X...@softimage.com
I don't think the thread was about what we'd like to see in viewports to be honest.
It's about metashaders and how to implement them with what's there already, not about requests for something else.

Alan Jones

unread,
Jul 1, 2008, 12:58:21 PM7/1/08
to X...@softimage.com
On Tue, Jul 1, 2008 at 5:44 PM, Raffaele Fragapane
<raffsx...@googlemail.com> wrote:
> I don't think the thread was about what we'd like to see in viewports to be
> honest.
> It's about metashaders and how to implement them with what's there already,
> not about requests for something else.

I'd take a long at the phong spdl. It's a metashader with a CG
implementation. The sourcecode
is contained within the spdl so should provide a decent reference
point for how to do it. Though
for metashaders with relation to the new rendering API I believe it's
more than likely largely
irrelevant as the current approach is for the renderers to take care
of their own rendertree translation
and I'm not aware of any using the metashader information to do this.

Cheers,

Alan.

Tim Leydecker

unread,
Jul 1, 2008, 3:57:24 PM7/1/08
to X...@softimage.com
It is about what we´d like to see in the viewport.

Personally thought, my point would be that I´d prefer
to get closest to the rendered, final result or have
useful tools that help in focusing on a task.

In regards to metashaders, from what is there, I would
find it useful to have a shader, as outlined earlier,
that takes precalculated data, á la ZBrush, like the
scenelighting baked into an environment map and by that
allows to model, animate or even texture with a result
close to what would be rendered more costly within the scene.

This is no future blabber, realtime AO has been shown by
nVidia, ZBrush uses OpenGL cleverly it´s just that I myself
can´t write such a metashader. Otherwise I´d do it without hesistation.

Cheers

tim

jason bright

unread,
Jul 1, 2008, 7:37:22 PM7/1/08
to X...@softimage.com
Tried to get metashaders to work (same files for realtime and mental ray) around v5.0-5.5 and never got it to work. Gave up and never looked back.

j

kim aldis

unread,
Jul 2, 2008, 2:26:51 AM7/2/08
to X...@softimage.com
Sorry Tim but no, it's not. Read the subject line, you're hijacking.

You could always start a new thread.

> -----Original Message-----
> From: owne...@Softimage.COM [mailto:owne...@Softimage.COM] On
> Behalf Of Tim Leydecker
> Sent: 01 July 2008 20:57
> To: X...@Softimage.COM
> Subject: Re: RT shader and Mentalray shader can be combined in a
> Metashader?
>
> It is about what we´d like to see in the viewport.
>

---

Raffaele Fragapane

unread,
Jul 2, 2008, 3:34:24 AM7/2/08
to X...@softimage.com
Maybe we read different emails, the ones I read asked why so much silence about metashaders :)
Most realtime AO shown doesn't exactly face the scenario XSI does, ZBrush does NOT use openGL cleverly (doesn't use it at all in fact), and doesn't take precalculated data about scene lighting either afaik.

Learn to write metashaders and everybody will love you apparently. You might also, by random chance, further your understanding of the shading/rendering subject :)

Tim Leydecker

unread,
Jul 2, 2008, 5:17:23 AM7/2/08
to X...@softimage.com
Thanks for the smileys, Raf. I´ll dedicate a MatCap to you.

Thanks for making me aware of the subject line, Kim.

I´m starting to get sorry for thinking out of the box.
If all I´m saying is that I would like to be able to
use a Rendertree/Metashader that has branches for RT
display and rendering but can´t since I couldn´t code it,
well yes, that is totally off subject and disqualifies
me for posting. Got that, especially since it´s been
so nicely expressed and backed up with tons of facts.

My correct answer would have been, if any, "no, I don´t".

Maybe someone using Metashaders/ RT display can actually
contribute, thought. I´ve gotten interested in the topic.

Raffaele Fragapane

unread,
Jul 2, 2008, 5:55:41 AM7/2/08
to X...@softimage.com
Sorry, I might have misunderstood, probably sidetracked by the part where you started talking about what metashaders you'd like to see and proceeded to describe an RTS and not the metastructure, or by the one where you started talking about what you'd like to see soft invest time in when the topic is about a feature that is already there, and figuring out how to use it.

As for not having written a shader disqualifying you from the conversation or not, that's not the point, you didn't even get remotely close to the mark when you started talking about ZBrush or what stuff you'd like to see in the viewport. Metashaders ARE NOT THAT.

That you continue to insist talking about metashaders solely in relation to RT display goes to show you don't really have much of a hold on the subject.
Metashaders are metastructures, they are about encapsulating in one (meta)shader a shading procedure that can respond differently based on the context.
It doesn't even need to be RTS, it could very well be MRay + RMan.

Now how does realtime ambient occlusion and vray fit in that I'd love to know.
Is it any clearer now why you were both off topic AND hijacking a thread?

Stefan Kubicek

unread,
Jul 2, 2008, 5:59:30 AM7/2/08
to X...@softimage.com
Thanks for everybodys input so far. I'll take a closer look at the Phong
node first and see if I can extend it with my custom stuff. Having an
already working shader as a starting point should help reducing early
mistakes.

For everybody diving into realtime shader authoring I can recommend
MentalMill (in open beta, download is free from the Mental images
website). Early tests look promising, even though the haptics of the app
itself are a bit clunky.
I also tried ShaderFX (a 3ds Max Plugin for node-based RTS authoring) but
never got any shader to
compile properly under XSI, even with the latest CGToolkit from Nvidia
installed, which you need to use CgFX shaders
in XSI reliably anyway.

Cheers,

Stefan

PS: I agree, having more realtime feedback in the standard XSI viewports
would be totally awesome (AO, SSS).
One should be able to do most of what he wants with the given toolset by
using custom cgFX
shaders, although that's not as elegant as an integrated solution that
does not require fiddling with additional nodes.

However, for me the fact that objects become unselectable in XSI's RTS
viewports (OpenGL and DX alike) is the biggest drawback so far. OpenGL is
slightly more usefuz as in DX viewports even manipulators disappear :-(
XSI is the only app I know that behaves in this way, in both Max and Maya
you can still work normally with your realtime shaded objects. Ultimately,
this reduces the usefulness of the RTS viewports down to a mere previewing
tool.

Tim Leydecker

unread,
Jul 2, 2008, 7:36:47 AM7/2/08
to X...@softimage.com
> Is it any clearer now why you were both off topic AND hijacking a thread?

Yes, thank you. It´s not as simple as adding:

MetaShader "ZBrush_CGXSI"
{
Renderer "Cg"
{
Name = "material-ZBrush_cg";
Options
{
"param1" = "diffuse";
"param2" = "specular";
}
}
}

and plugging that into the material node´s realtime input,
as technically, the above would already be part of the Material
and therefor it wouldn´t be neccessary to plug anything into
it´s realtime input but instead create everything for where
the textures (for realtime display) should go inbetween the
BeginText...EndText section I guess.

You´d end up with a material where you don´t have to manually
connect a CG shader to the realtime input port of the material.

It is misleading weather one would have to set up the metashader
for CG always as a type "rtrendercontext" thought?

After skipping through the SDK, I understand what Alan said
about probably none of the 3rdparty renderers using metashaders,
versionconflicts and errors from messing with the default *.spdls
are too risky to try and support for on the user´s end.

But I really don´t want to hijack the thread, I´m interested
in what Stefan is fiddling with. I know my own ideas already...

Cheers

tim

P.S: Stop it, Raf. I´m saying what I personally would prefer to
see adressed and would judge helpful for having a good realtime
feedback. Realtime feedback here means, getting an idea what the
render will look like, regardless of the renderer used.

This may include lights with fallof and intensities above 1, e.g
XSI´s displaymapping of shader properties and values in the viewport.

---

Stefan Kubicek

unread,
Jul 8, 2008, 1:09:23 PM7/8/08
to X...@softimage.com
I was seriously hoping that ICE wowuld also affect the way we work with
shaders, and from what I've seen of XSI7
so far I'd say my prayers have been heard. Is it valid to say that ICE
will render metashaders obsolete?

Steven Caron

unread,
Jul 8, 2008, 2:34:05 PM7/8/08
to X...@softimage.com
"ICE will render metashaders obsolete?"

no, but when this thread started, i took a rendertree setup that had a mental ray and realtime version of the tree. collapsed it to a shader compound, exposed the proper inputs and outputs, and then exported it for reuse.
Reply all
Reply to author
Forward
0 new messages