Kitty Corp Meow Mix Forums

Help & Tutorials => Help => Topic started by: iyenal on April 29, 2016, 10:07:06 AM



Title: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 29, 2016, 10:07:06 AM
How to do material (or shader) don't be affected by light in Brawlbox ?
It's for an image rendered in blender I want to integrate in an MDL0, so the light are already calculated, and also for performance issues.

Thanks !


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 29, 2016, 01:46:58 PM
Out of the topics I've bookmarked so far, this is the best help, but not sure if it'll work:

http://forums.kc-mm.com/index.php?topic=40785.0 (http://forums.kc-mm.com/index.php?topic=40785.0)


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 30, 2016, 03:38:35 AM
Thank for your help, the tutorial seems fix my problem but I haven't tested yet.
But there aren't a solution that don't need an hexadecmal editor, just BrawlBox ?
(I am not a good user of HxD)


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 30, 2016, 10:10:46 AM
Go ahead and read the last comment, which is the one that I meant.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 30, 2016, 10:25:48 AM
In the GBC Import Thread ?
Sorry but I don't found the shader, there 200 pages !
Do you can tell me the post number ?


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 30, 2016, 10:31:43 AM
He says in the OP(OP means Original Post), almost near the end, inside a spoiler; i.e. Inside the "how to import models (from start to finish)" spoiler; here's the direct link, but I encourage you to be able to figure it out on your own:

http://www.mediafire.com/?616odckzgqrp0cg (http://www.mediafire.com/?616odckzgqrp0cg)


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 30, 2016, 10:33:08 AM
Ok here :
"6.   now go into the mdl0 file and go to shaders and replace their shader with this one
http://www.mediafire.com/?616odckzgqrp0cg (http://www.mediafire.com/?616odckzgqrp0cg)"

Thanks ! But are you sure it don't affect performance ?


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 30, 2016, 10:40:33 AM
Pretty sure, since the material is just the lighting effects and the texture reference, basically. Can never hurt to back up your file and test it out.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 30, 2016, 01:24:21 PM
"lighting effects" Of what ? It's only texture UV with reference normally ?
Thanks anyway, you have saved me many hours of search.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 30, 2016, 01:31:08 PM
Sure, np. And what I mean is that, the materials and shaders basically only change how light affects the model, kind of like how in Blender, rotating around a default kind of mesh(In Solid mode) will have the Blender default lighting glow on different parts depending on what rotation it is, with materials and shaders, you could change those effects to change things like how glowy it is, which part glows, and stuff like that.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on April 30, 2016, 01:47:31 PM
OK; So with this shader can I use more poly than realtime lighting ,yes?


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on April 30, 2016, 02:05:17 PM
Polys have nothing to do with lighting, though; polys are how many triangles make up the model itself, and the lighting is how the model glints and whatnot in the light, so if you want to use more polys, go for it, but it'll make the filesize a little larger because of more polys.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: BlackJax96 on April 30, 2016, 08:16:04 PM
You can disable lighting by going to the material(s) in the MDL0, going to LightChannel0 under Lighting Channels, going to Color and setting Enabled to False.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on May 01, 2016, 06:01:54 AM
@windhunter7 : the lighting use the CPU and GPU, the global polygon count also, so if there are less calculs to do for lighting, poly can use more.
I have do game programming in unity, with the no lighting shader I can use 30% more poly in average. So I think the Wii system is same, using ATI GPU. But tell me if isn't.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on May 03, 2016, 08:30:34 AM
@BlackJax96 But the problem is thawhen you disable the lightchannel, the shader rest so performance aren't ameliored.

In fact, I want an shader that is doesn't affected by light so all the calculs related to lighting isn't done, so I can use more polygons. But if you know an other way to ameliore performance without removing polygons and textures tell me please.

Post Merge: May 03, 2016, 08:34:25 AM
if you want to use more polys, go for it
It means I can use more of 100000 facepoints without affecting performance ?! I'm lost...


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on May 03, 2016, 10:10:58 AM
I don't believe the Wii system is the same. In Unity, adding those lighting shaders will use up more data than using the default shaders(I use Unity, too), but in an MDL0 file, from what I understand, the materials and shaders take up the same amount of space regardless of which one you use, because these ones are just set up like booleans for their options; it's basically "Does this reflect light?" "Yes" or "No", as opposed to Unity's "Does this reflect light?" "If yes, How much?"

Post Merge: May 03, 2016, 10:12:16 AM
And you can improve performance by importing models with later versions of BrawlBox(.71, I think, has the optimization), because it will auto-optimize the model for you, and you can also lower the poly-count before importing, and you can also lower the texture resolution, as well.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: iyenal on May 03, 2016, 11:16:18 AM
OK now I understand. I can use light shader without problem, but in an OpenGX documentation I saw that more there are stages in shader, more is slow, is it true ? ;if yes how to do a performant shader with the less calculations possible ?


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: BlackJax96 on May 03, 2016, 05:08:55 PM
@BlackJax96 But the problem is thawhen you disable the lightchannel, the shader rest so performance aren't ameliored.

In fact, I want an shader that is doesn't affected by light so all the calculs related to lighting isn't done, so I can use more polygons. But if you know an other way to ameliore performance without removing polygons and textures tell me please.

Well as long as you're fine rendering the model without using any vertex colors or a solid material color, just don't use RasterColor or RasterAlpha as an input in the stages of your shader(s) and instead only pass texture color/alpha through SelectionD without multiplying it by RasterColor/Alpha.

Also you're not going to notice much of a performance hit if you enable lighting or if you add another shader stage or two in comparison to adding vertices to the model. Vertices are much more costly to performance.


Title: Re: How to do material (or shader) don't be affected by light ? (BrawlBox)
Post by: windhunter7 on May 03, 2016, 07:43:38 PM
Yes; the two ways that most lower the filesize are lowering polycount and texture res.

Post Merge: May 03, 2016, 07:44:43 PM
I use lowered texture res a lot when a file is too big or too laggy, since it's much easier than the lowering of the polycount, but lowering the polycount is better for lower lag while still being fairly detailed.