Submeshes with Shadowmap and Shader

Posted By: Ayumi

Submeshes with Shadowmap and Shader - 02/28/22 19:28

Hello,

i have a model with i.e. 3 textures , 3 submeshes and 3 shaders. The shader do the same for all 3 submeshes: He combine entSkin1 with entskin2.

Every mesh needs his own shadowmap.
It s not possible to have one shadowmap for 3 submeshes as one.

[Linked Image]

Skin1,Skin2,Skin3 are Shadowmaps with second coordinates.
Other Skins have a Shader on the texture set by MED (effect).


If i set the first Shadowmap to mesh 1, the result is right.
If i set the second Shadowmap to mesh2, the result is wrong.

The mapping from mesh1 is broken, mesh 2 is ok.
If i set the third Shadowmap to mesh3, the result is wrong.
The mapping from mesh1 and mesh2 is broken.

Any idea?
Posted By: Dooley

Re: Submeshes with Shadowmap and Shader - 03/01/22 01:12

I was able to get a working shadowmap. You have to import the model as FBX with two different UV sets. This is possible to do in Blender.

It's been a few months since I worked on it though, so bear that in mind. When you say sub-meshes, I think you are just referring to different closed sets of geometry? Or is it something more technical than that?
Posted By: Dooley

Re: Submeshes with Shadowmap and Shader - 03/01/22 01:14

Can you put all the different skins into one image? You would have to move the UVs around a bit, but then you can just have one Skin for all the textures, and one for the shadow map.

I'm assuming you set up the second UV correctly, but if you are not sure about that, I can maybe help walk you through that part.
Posted By: Ayumi

Re: Submeshes with Shadowmap and Shader - 03/01/22 08:13

Sub-mesh means a closed set of geometry, yes. Every texture needs his own mesh (1 model, 3 sub-meshes, 3 textures e.g).

It s not possible for me to use only one shadowmap because the model has 12 textures /12 groups of sub-meshes.
Of course i could split them but it s not nice laugh That s the last option.

I also tried 1 shadowmap for all groups but if you activate the second UV-set in MED, you have to set a the shadomap to a mesh. Otherwise you can not use a skin mapping. If i try to set the the shadowmap for all groups not using a skin mapping, the shader should use entSkin2 with no coodinates (0,0).

Posted By: Dooley

Re: Submeshes with Shadowmap and Shader - 03/01/22 15:10

You may have to write a custom shader to match the way your model is set up.

Reach out to Jumpman ... he's good with shaders and may be able to help.
Posted By: Ayumi

Re: Submeshes with Shadowmap and Shader - 03/01/22 16:41

Ok thank for your help.
Posted By: Ayumi

Re: Submeshes with Shadowmap and Shader - 03/01/22 21:50

My friend has found a solution.
You have to merge all groups in MED, than add the new shadowmap, activate second UV set and add the Mapping. The Mapping should be contains all Coordinates from the meshes.

The order is important. Anyway, it works.
Posted By: Dooley

Re: Submeshes with Shadowmap and Shader - 03/02/22 20:38

Yeah, it is tricky to figure out. But it works laugh
© 2024 lite-C Forums