Page 1 of 2
How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Sun Jun 22, 2025 8:12 pm
by minimy
Helllo, i have problems with shadows in my objects, after read the ogre.log i got this message:
Warning: barbudo.mesh uses an old format [MeshSerializer_v1.41]; upgrade with the OgreMeshUpgrader tool
My OgreMeshUpgrader like to be obsolete.
Where can download the last exe of OgreMeshUpgrader?
Thanks for help!
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Sun Jun 22, 2025 9:15 pm
by minimy
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Sun Jun 22, 2025 9:19 pm
by minimy
But may be not a problem with my mesh version.
After update the mesh i have no shadow. (old mesh no shadow too)
this is with PB-6.21
This is with original mesh in PB-6.02
Any idea why have no shadows... what may be?
Thanks for help!
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Sun Jun 22, 2025 9:31 pm
by miso
Are you using the builtin shadows, or pfShadoko's new shader system?
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jun 23, 2025 8:36 am
by Fred
IIRC the new mesh format has auto build shadow volume off, could you try by adding
https://www.purebasic.com/documentation ... olume.html ?
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jun 23, 2025 1:03 pm
by minimy
Hello and thank you for the help.
I'm using the native PB shadows. I've tried BuildMeshShadows after load the object, but it doesn't work either.
The weird thing is that shadows work, but when the (human) object enters the screen, all shadows disappear.
It is as if the geometry of the shadows disappeared.
with pf_shadoko shading, shadows work very good but the shadow over the object is corrupt, and i see vertex are moved out of place. (shadows are really nice with soft edges)
Here any captures to explain what happend. Thanks again!
This is with PB native material and pf_shadoko shadows. Shadows are fantastic but the object no catch shadows.
And this is with pf_shadoko anim material and shadows. (#SO_Txcolor|#SO_Anim)

Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jun 23, 2025 2:57 pm
by miso
I understand, that it works with old pb versions stencil shadows, still my guess would be wrong face normals injected by the 3d software exporter you use. If possible, try to save your mesh in a format that saves only triangles, not using any quads. Also, buld mesh tangent after that (if not presented). (It can be done in pb with buildmeshtangent() command. Shadokos shaders requires it. (and those considers bones).
I find his latest contribution very versatile and upgradeable.
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jun 23, 2025 5:24 pm
by minimy
First of all, thank you for the help with this problem. Yes, that makes sense.
But the meshes are triangulated. I have confirmed that the faces or normal are well oriented (outwards) in all the models I have tested.
This model is designed with makeuman, the result is the same as exported with other CAD software.
In all models i add build shadows and tangents.
prota_mesh= LoadMesh(#PB_Any,"salvaje.mesh")
BuildMeshTangents(prota_mesh)
BuildMeshShadowVolume(prota_mesh)
And tested with double-side material like this MaterialCullingMode(prota_mate,#PB_Material_NoCulling). but no result.
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Tue Jul 08, 2025 9:01 am
by pf shadoko
can you give me your mesh so I can see where the problem comes from
(try without WorldShadowsEx to see)
PS: BuildMeshTangents is only useful if you use a normalemap
BuildMeshShadowVolume is not useful here, it's for stencil shadows, I use shadows texture
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Fri Jul 11, 2025 11:21 am
by pf shadoko
the problem comes from the number of weights in the skeletal animation
CreateMaterialEx takes into account a maximum of 3 weights, which should have been more than enough
but obviously the software you're using takes 4, without sorting them
I might take into account #SO_Anim4 (for 4 weights), if I can't find a more elegant way of solving the problem
in the meantime you can correct the bug by replacing :
line 135 with
Code: Select all
wcooa="opos=vec4(0);onormal=vec3(0);@otg1%for(int i=0;i<4;i++){%if(blendWeights[i]>0.0){%mat3x4 bonemx=P4[int(blendIndices[i])];%opos+=vec4(gl_Vertex*bonemx,1)*blendWeights[i];%onormal+=(gl_Normal*mat3(bonemx))*blendWeights[i];%@otg2%}%}%opos=world_mx*opos;%onormal=mat3(world_mx)*onormal;%@otg3%"
(I've just replaced i<3 with i<4, but this will cause problems for animations with weights <4 (ideally the same should be done for shadow caster code).
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Sat Jul 12, 2025 1:42 pm
by minimy
Hello PF Shadoko, thanks again for your time and help.
After change line 135 with the new 'wcooa' return an error in line 213 MaterialShaderTexture(material,tx1,tx2,tx3,tx4) material not initialised.
Im testing with same model 'salvaje.mesh' if change to original line 135 work fine but like in this image:

Is the salvaje curse

Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jul 14, 2025 5:58 pm
by pf shadoko
hi,
I put the line to modify in "code" tags (cf post above)
it should work
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Mon Jul 14, 2025 9:12 pm
by minimy
YEEEESSS!! Now is working perfect! thanks a lot pf_shadoko!!
If you were around I would buy you a couple of beers!

Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Tue Jul 15, 2025 4:24 am
by miso
Does the shader code runs faster, if I change this downwards? For simpler models, where theres only 1-2 weighted bones? (I assume the answer is yes)
Re: How can upgrade a mesh v1.41 to work with PB-6.21?
Posted: Tue Jul 15, 2025 5:39 pm
by pf shadoko
@minimy :
I think it would be preferable to reduce the number of weights (it's rare to need more than 2)
your conversion software doesn't offer this?
@miso :
I don't think this will have a significant impact on performance
(I recommend using BuildMeshLOD instead)