so, im not get approval from heaven for continue it's and stop with this result:

shadows look really better, but maked only 2 items: transparent, solid rendering of shadow.
im not will publish full source code bcz it's not have reason (many research for other main.exe), only 2 functions for understand concept:
Code:
// global static function
void GameRenderer_RenderGround(int mode) {
glEnable(GL_STENCIL_TEST);
glClear(GL_STENCIL_BUFFER_BIT);
// disable draw in other buffers, will draw only in stencil
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
// setup stencil buffer
glStencilFunc(GL_ALWAYS, 1, 0xFFFFFFFF);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
imp_GameRenderer_RenderGround(mode); // render ground to stencil
// continue draw stencil only with "1" id & save buffer for continue
glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
// restore other buffers
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
glDisable(GL_STENCIL_TEST);
imp_GameRenderer_RenderGround(mode); // render ground to normal
}
// class method
void CResourceExtension::CreateObjectShadow(MUModelObject* this_, int unk_0, int unk_1, int part_from_index, int part_to_index, int scale) {
if (this_->m_FileInfo.PartPoolSize <= 0) {
return;
}
if (g_GameWorld_Scene_Current != 7) { // we check world bcz atlans already enable blend
GameGL_EnableBlend(false);
}
glColor4f(0.0f, 0.0f, 0.0f, 0.3f); // 30% opacity for shadow
GameGL_DisableTexture2d(false);
GameGL_DisableDepthMask();
glPushMatrix();
// enable stencil and continue draw
glEnable(GL_STENCIL_TEST);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
float width = 2000.0f;
float height = 4000.0f;
if (g_GameWorld_Scene_Current == 30/*castle siege*/) {
width = 2500.0f;
height = 4000.0f;
}
int part_index_start = 0;
if (part_from_index != -1) {
part_index_start = part_from_index;
}
int part_index_end = this_->m_FileInfo.PartPoolSize;
if (part_to_index != -1) {
part_index_end = part_to_index;
}
for (int i = part_index_start; i < part_index_end; i++) {
if (i == unk_1) {
continue;
}
MUModelPart* part_object = &this_->m_PartPool[i];
if (part_object->TrianglePoolSize <= 0 || part_object->Index == unk_0) {
continue;
}
glBegin(GL_TRIANGLES);
for (int j = 0; j < part_object->TrianglePoolSize; j++) {
MUModelPartTriangle* triangle_object = &part_object->TrianglePool[j];
for (int k = 0; k < triangle_object->field_0; k++) {
MUVector3f vertex;
int triangle_world_index = triangle_object->PositionPoolIndex[k];
int world_vertex_memory_offset = 0x7702578 + (180000 * i) + (triangle_world_index * 12);
MUVector3f* world_vertex = &*(MUVector3f*)world_vertex_memory_offset;
vertex.X = world_vertex->X - this_->field_6C.X;
vertex.Y = world_vertex->Y - this_->field_6C.Y;
vertex.Z = world_vertex->Z - this_->field_6C.Z;
vertex.X = (vertex.X + width) * vertex.Z / (vertex.Z - height) + vertex.X;
vertex.X += this_->field_6C.X;
vertex.Y += this_->field_6C.Y;
vertex.Z = 5.0f + this_->field_6C.Z + scale;
glVertex3fv((GLfloat*)&vertex);
}
}
glEnd();
}
glPopMatrix();
glDisable(GL_BLEND);
GameGL_EnableDepthMask();
glDisable(GL_STENCIL_TEST);
}
P.S.: easy fix for creation shadows from items

method in one picture, can be founded with simple calls compare from CreateShadow.