mtl_shaded - Not to be used on models??

Posted By: Anonymous

mtl_shaded - Not to be used on models?? - 11/02/15 18:51

So I've had augments in the past with newbies over this manual entry
Quote:
mtl_shaded --shaded blocks-- 0 200 200 0 0 2

http://www.conitec.net/beta/amaterial2.htm

While I assort that mtl_shaded is just another shader and can be use on anything. Other's insist that it must only be used on blocks.

I in fact use it all the time on ent -models

So before asking the "Dev's" can I get a ruling from the community? It would seem at some point in the A6-A8 cycle, there was a comment from the "Dev's" to never use this shader on anything but level blocks.


Thank you for any clarification
Mal
Posted By: MasterQ32

Re: mtl_shaded - Not to be used on models?? - 11/09/15 18:41

I think mtl_shaded has a support for light maps on a second UV set

mtl_model (?) does not support/feature the light mapping thus a normal model will look good.
Posted By: HeelX

Re: mtl_shaded - Not to be used on models?? - 11/10/15 20:53

At some time in the A6 to A7 shifting phase there existed a statement from JCL in AUM magazine (I believe) that he imagined to have the complete light and shadowing part of Gamestudio being performed by a shader pipeline.

So it makes sense to me that there are two materials for "classic" block rendering (from WMB style levels) - one shader for "flat" surfaces and one for lightmapped surfaces (just because you have the precalculated lighting information).

At least I would do so if I were to integrate lightmapped content into my rendering pipeline to blend it with dynamic lights and shadows.

I would be careful, if I were you - maybe the shader code is written just for shaded block with assumptions you don't know. At least I would assume that there is a texture lookup and a lightmap lookup, using the second UV set, which was generated by the WMP lightmapper.

I did a search for mtl_shaded in the engine code, but there is just the MATERIAL* pointer, hence I think it is set by the engine. To understand what it is beneath, I would try to dump the content of the char* effect, void* d3deffect or void* d3dmaterial pointers.

However I would say it is a waste of time - if it works for you - go with it.
Posted By: Anonymous

Re: mtl_shaded - Not to be used on models?? - 11/11/15 20:44

Thank you both, I will try to see if mtl_model looks as well when it's default setting are dropped down the mtl_shaded, ig. ambient and such..

Mal
Posted By: sivan

Re: mtl_shaded - Not to be used on models?? - 11/20/15 09:05

Due to my experiences, you can use mtl_shaded and mtl_flat freely, they seem to be nothing special, just ordinary globally defined materials with a pre-assigned effect, probably a simple ffe.

You can create new custom material to test it, and utilize the 2nd uv set to get lightmap data to your shader (texture entSkin2;), as I have done it in MapBuilder with map-entities (by default they use mtl_mapent). In case of terrains no 2nd uv set is utilized, there you can access its LightMap bitmap (texture LightMap;).

I dealt with it a long time ago, but as I remember level blocks worked correctly with the same material+effect as map-entities (tested with a terrain and a prefab). Check "sc_obj_level_MB.fx", the corresponding lines are commented out, but search for "// lightmap usually looks bad with dynamic shadows", and you can uncomment all the relevant lines.

Moreover, to get correct lights probably you need to use VecLight instead of VecColor, which sums entity rgb colour (=VecColor) with prv colour (which strangely has no separate vector). It is a bit tricky to get similar light intensity as the engine default ffe produces...
Posted By: Anonymous

Re: mtl_shaded - Not to be used on models?? - 11/20/15 19:35

^-- This is a bit for me to absorb, however I did post in the shader section. There is a visual difference between shaded and mtl_model ents' in dark shadow based levels. Is it just possible to adjust the settings in the mtl_model to get closer results. - Please forgive my ignorance still haven't learn much about shaders, my brains broken for learning everything to be a one man dev team lol.

Mal
Posted By: sivan

Re: mtl_shaded - Not to be used on models?? - 11/21/15 14:19

indeed, the lighting of map-entities (and blocks) differs from models slightly. I use a little different multipliers to get the same lighting for a map-entity and a model created from it. just can't always remember for all the details... but it is not mtl_flat or mtl_shaded dependent !!!
© 2024 lite-C Forums