Thanks a lot @kosmonautgames. I will remove the dragons and let you know the result.
Hi @kosmonautgames,
I am trying load my custom asset into this engine. Its loading fine, but not loading the textures which are mapped with effect.
//This is how I load,
AddEntity(_assets.ClothModel, new Vector3(15/Z/, 5/X/, -10/Y/), -Math.PI/2, 0, Math.PI / 2, 1);
It shows only shadows and the actual model is transparent.
If I give any other material like Emmisive or Basic then it is visible.
Please let me know why is it so?
I donât have a computer right now, Iâll look into it once I have it working again
would it be possible to give me the object files for testing?
EDIT:
If you midn you can also try to update and load the models like this
HelmetModel = content.Load<Model>("daft_helmets");
HelmetModel = ProcessModel(HelmetModel);
or
HelmetModel = ProcessModel( content.Load<Model>("daft_helmets"));
Hi @kosmonautgames, I do call ProcessCloth to setup textures into effect.
I thinks the problem is with .TGA files! Do I need to convert all .TGA file textures to .jpg?
Thanks,
Bala
Its not working even after changing textures into Jpeg.
Hereâs the model uploaded link,
https://drive.google.com/file/d/0BzMxz_l22RyZS1hvMFBrbHpVNWs/view?usp=sharing
Looking forward to your reply!
Thanks,
Bala
thatâs what it looks like to me - is it incorrect?
EDIT:
There is a flaw with the basic XNA/Monogame basiceffect importer. It accepts only one texture - diffuse. Normal/Specular are not imported. That would have to be done manually, which is a pain. I do that for the sponza scene though.
I should write a different importer which supports all of that, but then I cannot rely on the basic monogame version any mroe - I would have to compile my own. Which i cannot do since compiling any version for Monogame breaks the shaders since ⌠ugh, just not worth the hassle for such a basic project.
When a model only has one texture itâs pretty easy to make a material, I can do this for example
stormtrooperMaterial = CreateMaterial(Color.White, 1, 0,
content.Load(âArt/test/stormtrooper_albedoâ),
content.Load(âArt/test/stormtrooper_normalâ),
content.Load(âArt/test/stormtrooper_roughnessâ),
content.Load(âArt/test/stormtrooper_metalnessâ),
null,
MaterialEffect.MaterialTypes.Basic
);
Hi @kosmonautgames,
Thatâs awesome!
Please can you share the Asset.cs code.
Anyway I will try creating material as you said and check.
Thanks a lot!
-Bala
Hi @kosmonautgames, I am not using BasicEffect, I am assigning all the texture maps into MaterialEffect as you did inside ProcessSponza() function.
I donât why its not rendering on my side.
This is how I am processing,
private void ProcessCloth()
{
foreach (ModelMesh mesh in ClothModel.Meshes)
{
foreach (ModelMeshPart meshPart in mesh.MeshParts)
{
MaterialEffect matEffect = new MaterialEffect(meshPart.Effect);
BasicEffect oEffect = meshPart.Effect as BasicEffect;
matEffect.DiffuseColor = oEffect.DiffuseColor;
if (oEffect.TextureEnabled)
{
matEffect.AlbedoMap = oEffect.Texture;
string[] name = matEffect.AlbedoMap.Name.Split('\\');
string compare = name[2].Replace("_0", "");
if (compare.Contains("_diff"))
{
compare = compare.Replace("_diff", "");
}
foreach (Texture2D tex2d in ClothTextures)
{
if (tex2d.Name.Contains(compare))
{
//We got a match!
string ending = tex2d.Name.Replace(compare, "");
ending = ending.Replace("Skinned/textures/", "");
if (ending == "_spec")
{
matEffect.RoughnessMap = tex2d;
}
if (ending == "_ddn")
{
matEffect.NormalMap = tex2d;
}
if (ending == "_mask")
{
matEffect.Mask = tex2d;
}
}
}
}
meshPart.Effect = matEffect;
}
}
}
And I am adding the model in MainLogic.cs file like this,
AddEntity(_assets.ClothModel, new Vector3(15/*Z*/, 5/*X*/, -10/*Y*/), -Math.PI/2, 0, Math.PI / 2, 1);
This what my result,
Thanks and Regards,
Bala
try with the _mask commented out
Hi, Thanks for the quick reply!
It works only if I comment â_ddnâ commented out.
Do you comment the same there while rendering cloth? or you donât map any other textures except diffuse.
Thanks,
Bala
When importing the model, have you checked âCreateTangentFramesâ?
Otherwise normal maps wonât work
Great! It works with Normal map after enabling âCreateTangentFramesâ.
Thanks for the help and nice rendering engine.
I would like to add Skinned Effect with your engine, I will try to implement it with your shader.
Please let me know you have already done itâŚ
Thanks,
Bala
i donât even know if itâs supported in base monogame, definitely a thing i would like to add eventually.
No worries! I will let you know once its done. Thanks.
Hi @kosmonautgames,
I have successfully integrated the Skinned Effect with your Engine.
But I have worked on only GBuffer Shader. Could you please help me out to implement it on other shaders as well (Like Shadow)
Here is the output: (Dont worry about Dude legs. Its a problem of Monogame .fbx importer, it will work fine for other files :))
Thanks,
Bala
oh cool how did you do it
Here is the source code, compile it and run it on your side.
I have very bad frame rate and advice me on what other shaders VertexShaders have to be changed.
It might me quick and dirty implementation, I can create modular one once we fix all the Shder side implementation.
Here is the code link,
Thanks,
Bala
At a first glance I thought you changed the animation to something that could be used for a zombie game
Good work!
thank you. Can I ask where you have these Loome libraries from? Google seems to find nothingâŚ
Iâve tried it out, but for some reason only the skinned model is visible. It has some severe artifacts and the normals/tangents are not updated for animation i think, but itâs really cool that there is animation.
Iâll check out other skinning implementations and look how they do it.