Newbie Spellweaver
- Joined
- Aug 12, 2015
- Messages
- 14
- Reaction score
- 19
Hello again,
in this time im want talk about mu online shadows, as everybody know it's very ugly element of this game, but maybe we can improve it's?
im start from idea that better use transparent shadows (as in atlants), example:
for get analogy effect in any location im decompile function which calculate and render shadows of game object:
and it's work fine, shadows now transparent in any location, but im detect funny problems:
1. when triangles get collision shadow work incorrect (with this need help)
2. shadow does not display weapon / items / wings (it's im understand how fix, np)
my thoughts about solution for problem №1:
a) merge triangles in group and render single object after (but don't know how can make this, found one idea in
b) add black texture which must hide triangles (dont know will help or no, if someone have experience - please reply)
so, im have null experience with 3d graphic and opengl, but maybe u know how we can improve it's without changing the basic principles (creation shadow map is not good idea, many for recode) and can help with this?
@laudaicat
what do you think about this?
in this time im want talk about mu online shadows, as everybody know it's very ugly element of this game, but maybe we can improve it's?
im start from idea that better use transparent shadows (as in atlants), example:
for get analogy effect in any location im decompile function which calculate and render shadows of game object:
Code:
void CMUModelObjectPrototype::RenderShadow(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) { // now we have 0.2f transparent in any location
GameGL_EnableBlend(false);
glColor4f(0.0f, 0.0f, 0.0f, 0.2f);
}
GameGL_DisableTexture2d(false);
GameGL_DisableDepthMask();
glPushMatrix();
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); // like array [100][150]
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();
}
and it's work fine, shadows now transparent in any location, but im detect funny problems:
1. when triangles get collision shadow work incorrect (with this need help)
2. shadow does not display weapon / items / wings (it's im understand how fix, np)
my thoughts about solution for problem №1:
a) merge triangles in group and render single object after (but don't know how can make this, found one idea in
You must be registered to see links
, but method for new version of opengl)b) add black texture which must hide triangles (dont know will help or no, if someone have experience - please reply)
so, im have null experience with 3d graphic and opengl, but maybe u know how we can improve it's without changing the basic principles (creation shadow map is not good idea, many for recode) and can help with this?
@laudaicat
what do you think about this?
Last edited: