Multi Model Materials

Posted By: indiGLOW

Multi Model Materials - 03/16/08 20:06

It's been a while since I looked at shaders and materials for A6, so please forgive my ignorance if this proves to be a dumb question



Can you assign multiple/different shader/material effects to a model?

I have a model with 8 skins and would like to assign different shaders like normal and bump mapping, reflection etc.

Is this possible?

Any pointers or assistance much appreciated.
Posted By: mpdeveloper_B

Re: Multi Model Materials - 03/17/08 14:06

yes, just apply an fx file to each skin, and you can use materials and models at the same time, it's very much possible, we're using this feature as well
Posted By: GBStudio

Re: Multi Model Materials - 03/17/08 16:57

Quote:

yes, just apply an fx file to each skin, and you can use materials and models at the same time, it's very much possible, we're using this feature as well




I have the same problem. I do apply the fx files to the model (as external files), and I have placed the fx files and the textures in the folder, but the shaders don't work. I have no idea what is wrong. Please explain in more detail.

Kindest Regards
GBStudio
Posted By: indiGLOW

Re: Multi Model Materials - 03/17/08 19:29

Just to clarify, I have not had a problem as yet

I was enquiring as to the potential of this method and if GS supported it. However, it does seem like I would gain also from some explanation of this process, so if there are a few pointers going it would be much appreciated.

I've just got in from work and will be sitting down to investigate this further, maybe I will even shed a little light on the process myself.

Quick shout out to mpdeveloper_B, thanks for the reply much appreciated, very interesting indeed.

Thanks again

EDIT:

A little research later and I would like to restate the question, to be sure that I asked correctly. In my image above, I have selected the 3rd skin in the stack, Skin Name: #material183. I would like to apply a shader to only this skin, e.g a bump map shader. I only want it applied to this skin. Is that possible? If so what are the limitations? I am reading about 4 model skins and 4 externals in the manual, does this apply here?

Thanks in advance for any help
Posted By: GBStudio

Re: Multi Model Materials - 03/18/08 09:17

Quote:

A little research later and I would like to restate the question, to be sure that I asked correctly. In my image above, I have selected the 3rd skin in the stack, Skin Name: #material183. I would like to apply a shader to only this skin, e.g a bump map shader. I only want it applied to this skin. Is that possible? If so what are the limitations? I am reading about 4 model skins and 4 externals in the manual, does this apply here?




I was searching the forum for multiple shaders on the same model, and I found this:

http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Board=UBB3&Number=685645

I think for applying a fx file to one skin, you should check the "effect setup", then open definition file roll, and choose the fx file you want. I guess the fx file would be added only to that skin.

But when I apply the fx files to the model skins (and of course I place the fx files and texture files in the game directory) the shaders don't work!!! It is two days that I'm searching the forum, wiki, manual, etc... but I didn't find any reason for that. The shaders work when I apply them to the entities in code, so the shaders are correct. But when I apply them to the model skins in med they don't work.

I wish someone who knows the solution helps us...

Kindest Regards
GBStudio
Posted By: Quad

Re: Multi Model Materials - 03/18/08 15:16

Quote:


I was searching the forum for multiple shaders on the same model, and I found this:

http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Board=UBB3&Number=685645

I think for applying a fx file to one skin, you should check the "effect setup", then open definition file roll, and choose the fx file you want. I guess the fx file would be added only to that skin.

But when I apply the fx files to the model skins (and of course I place the fx files and texture files in the game directory) the shaders don't work!!! It is two days that I'm searching the forum, wiki, manual, etc... but I didn't find any reason for that. The shaders work when I apply them to the entities in code, so the shaders are correct. But when I apply them to the model skins in med they don't work.

I wish someone who knows the solution helps us...

Kindest Regards
GBStudio




maybe the shaders you are using needs more than one skin(like normal mapping) and trying access the via entity(like tries to get entities(what shader apllied to) 1st and 2nd skin). This shaders must be applied to entity, but i guess a small retouch will solve the problem.
Posted By: fogman

Re: Multi Model Materials - 03/18/08 16:10

Here you go:

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/816663/an/0/page/0#Post816663
Posted By: GBStudio

Re: Multi Model Materials - 03/19/08 11:24

Quote:

maybe the shaders you are using needs more than one skin(like normal mapping) and trying access the via entity(like tries to get entities(what shader apllied to) 1st and 2nd skin). This shaders must be applied to entity, but i guess a small retouch will solve the problem.




You are right, there may be a problem with the shaders I'm using.

Quote:

Here you go:

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/816663/an/0/page/0#Post816663




Good Job! Congratulations

Here is the link to my file:

http://host-a.net/KooKoo/multi%20shaders.zip

I really have no idea what is wrong with it...

Thanks for your time
Kindest Regards
GBStudio
Posted By: indiGLOW

Re: Multi Model Materials - 03/21/08 16:02

Thanks for the great links guys, I am busy putting the core level geom together, expected to be completed this weeked and then I want to have a crack at getting some nice normal mapping shaders applied.

Thanks for all your help, I will post some screenies when I get it working.
Posted By: Nidhogg

Re: Multi Model Materials - 03/22/08 16:24

Quote:


But when I apply the fx files to the model skins (and of course I place the fx files and texture files in the game directory) the shaders don't work!!! It is two days that I'm searching the forum, wiki, manual, etc... but I didn't find any reason for that. The shaders work when I apply them to the entities in code, so the shaders are correct. But when I apply them to the model skins in med they don't work.

I wish someone who knows the solution helps us...





I read in the manual I think it was that the fx files had to be in the model folder/directory. I am not 100% but maybe it wouldn't hurt to give it a try.

If not, maybe run the shaders via your action for the model.

eg: if(my.skin == 1){my material = bumpmap_shader etc etc}
Posted By: indiGLOW

Re: Multi Model Materials - 03/25/08 19:44

Slightly off topic, but during my experimentation I discovered that, (at least it seems as so), models with multiple skins, do not cast stencil shadows??!??

I have a model comprised of 3 parts, the body, a bottle and a small note. In this state, the stencil shadow would not cast on my levels floor, also made with models.

As the model appeared to self cast, I put it down as 'stencil shadows' dont cast 'on to' multi-skin models.... However, it appears I am in error, indeed, shadows cast 'on to' multi-skin models, but are not cast by them...

anyone able to shed any light on this... or shadow

Meanwhile, on a shader related note, I have managed to complete my basic level and object modeling and have begun the process of applying shaders. So far I have only applied a simple Bump shader, straight out of the manual, which works nicely. However I would like to apply a normal, shader and diffuse map to level objects and similiar to the walls and floor of my level model.

I have read the links above and found a great deal of help, although I am unclear as to what Ventilators Mesh library, or indeed why I need this, so I would appreciate anyone giving a few pointers. I also have Sphere2, although we are not using this as a template, would be cool to hook up a couple of Matt's shaders...

I will share a couple of screenies of my work in progress, maybe this will help... (upload some later tonight)


Thanks in advance, and arrears, to all those offering help, you are the heart and soul of GS
Posted By: indiGLOW

Re: Multi Model Materials - 03/28/08 20:32

First a couple of screens:



Here is a shot of the small level with a couple of objects added. The Cooler has a simple bump map shader applied.


Thanks to this thread:23 Post Processing Shaders for A6 Com/Pro, I have been able to add some nice basic shaders to the view.

They look very cool, even in this early stage and I will be including more effects like these: Nightvision, FlashBang, Dizzy, DOF, etc.

However what I am really interested in is, how do I apply different shaders to the level model, to include bump mapping, specular mapping etc.



I am still unclear as to what the mesh.dll is that is mentioned in Fogman's thread 'Lightmap+Normalmap for Subsets' as provided above, so in the meantime I am looking into how materials are applied and trying to get my head around it.

I am also going to investigate 'Soft Shadows' as I want to create a realistic environment where light and shadow is used to capture the right ambience/feeling.

Any pointers, always appreciated

TIA
Posted By: RAFU

Re: Multi Model Materials - 03/28/08 21:44

indiGLOW,
I am not sure what version of game studio you are running, But with A7 you can now directly assign materials to level blocks inside WED. It is also rendered differently so you do not get the slow downs that made level shaders impossible on A6.
Posted By: indiGLOW

Re: Multi Model Materials - 03/29/08 10:42

Thanks RAFU, I have been taking a look at a couple of A7 demos, the Venice one and Warehouse (Although this wont run for me for some reason).

I've been tring to work out if I should upgrade to A7 Pro from A6 Pro, but I am worried about lack of backwards compatability, and that I would need to learn a load more again.

Thanks RAFU, I will give it much thought
Posted By: indiGLOW

Re: Multi Model Materials - 04/27/08 14:10

Sorry for not coming back to this thread sooner, especially since I had some questions that I hoped I could come back to you guys with.

We've donated a couple of models this week, one of which helps to highlight, what we are hoping to achieve, and why I am interested in assigning different shaders to different materials of a .MDL.



In the above model, the main torso has both a diffuse and mormal map created for it, in this case we've included the textures within the file. However we would like to work entirely with external textures and this in itself creates a few minor hurdles.

However the real meat of the issue is how do we write shaders that can be applied to different materials of a model, that also uses different textures dependant on each model. Most importantly we want to do this entirely on-the-fly; using both logical extrapulation, in the case of _NRML.tga or _SPEC.tga and direct designer settings for unique edge cases.

In other words writing a 'Shader Manager'.

We are already developing our own inhouse set of comprehensive tools, that make managing the data relativly simple to implement, however writing the actual shader manager is a task that I have not really kicked off yet.

Metaphorically, its hanging around on yellow post-it notes in my head, but we are now ready to begin to tackle this issue.

Really would appreciate some veteran help here, and please forgive my ignorance when it comes to coding a shader, but I have a very firm grip on the subject as a whole.

Cheers for any help you can offer, thoughts, suggestions and pointers for obvious pitfalls and good shader strategy would be much appreciated.

TIA
Posted By: indiGLOW

Re: Multi Model Materials - 05/01/08 18:53

No Takers?

Ok well I will be taking a full stab at this over the weekend, I am hoping to have entity dependancies nailed some time tonight, tomorrow. So all being well I will be taking the first steps towards building the shader manager.

Some early thoughts.

- We would like to work exclusivly with external textures. (Certainly for the extra shader textures, but also diffuse maps.)
- To support within the manager different combinations of materials and shaders, possibly with some template/default settings for trees and such like.
- Other dependancies such as damage states for models and their associated skins will also be included here.
- Collision models should also be included in the dependancy structure.

The upshot is that the manager should allow both materials/shaders to be manipulated and set, but also to link together all models (components) for every level entity.

Obviously special cases such as game entities such as NPC / player models will not be handled here.

Not sure if anyone is interested in the above, I know there is a tendancy for some peeps here to talk about what they are 'going' to do, and often fail to deliver the product, but... all being well it may provide a historical account of how we managed to get from A - B.

C&C Welcome as always \:\)
Posted By: indiGLOW

Re: Multi Model Materials - 05/23/08 18:39

After a recent painful post regarding ent_mtlset and it's usage, I have managed to implement a simple multi-material, multi-shader function which I am now integrating with our toolsuite.

Thanks to everyone who helped out, and accept my apologies for the random postage, littering the threads.

Thanks again
© 2024 lite-C Forums