Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, howardR, Quad), 505 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mtl_shaded - Not to be used on models?? #455906
11/02/15 18:51
11/02/15 18:51

M
Malice
Unregistered
Malice
Unregistered
M



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

Re: mtl_shaded - Not to be used on models?? [Re: ] #456110
11/09/15 18:41
11/09/15 18:41
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
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.


Visit my site: www.masterq32.de
Re: mtl_shaded - Not to be used on models?? [Re: MasterQ32] #456114
11/10/15 20:53
11/10/15 20:53
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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.

Re: mtl_shaded - Not to be used on models?? [Re: HeelX] #456142
11/11/15 20:44
11/11/15 20:44

M
Malice
Unregistered
Malice
Unregistered
M



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

Re: mtl_shaded - Not to be used on models?? [Re: ] #456363
11/20/15 09:05
11/20/15 09:05
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
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...


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: mtl_shaded - Not to be used on models?? [Re: sivan] #456375
11/20/15 19:35
11/20/15 19:35

M
Malice
Unregistered
Malice
Unregistered
M



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

Re: mtl_shaded - Not to be used on models?? [Re: ] #456404
11/21/15 14:19
11/21/15 14:19
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
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 !!!

Last edited by sivan; 11/21/15 14:20.

Free world editor for 3D Gamestudio: MapBuilder Editor

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1