Renamed some fields in Shadow
This commit is contained in:
@@ -324,7 +324,8 @@ namespace rndr {
|
||||
draw_pass_shadow_begin_make_shadowmap(shad, v11[i], j);
|
||||
disp_manager->draw((mdl::ObjType)(mdl::OBJ_TYPE_SHADOW_CHARA + v11[i]));
|
||||
if (disp_manager->get_obj_count((mdl::ObjType)(mdl::OBJ_TYPE_SHADOW_OBJECT_CHARA + v11[i])) > 0) {
|
||||
gl_state_set_color_mask(field_2F8 ? GL_TRUE : GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
gl_state_set_color_mask(show_stage_shadow
|
||||
? GL_TRUE : GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
disp_manager->draw((mdl::ObjType)(mdl::OBJ_TYPE_SHADOW_OBJECT_CHARA + i));
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
}
|
||||
@@ -1117,7 +1118,7 @@ static void draw_pass_shadow_begin_make_shadowmap(Shadow* shad, int32_t index, i
|
||||
glClearDLL(GL_COLOR_BUFFER_BIT);
|
||||
glScissorDLL(1, 1, tex->width - 2, tex->height - 2);
|
||||
|
||||
float_t range = shad->get_range();
|
||||
float_t shadow_range = shad->get_shadow_range();
|
||||
float_t offset;
|
||||
vec3* interest;
|
||||
vec3* view_point;
|
||||
@@ -1136,7 +1137,8 @@ static void draw_pass_shadow_begin_make_shadowmap(Shadow* shad, int32_t index, i
|
||||
mat4_translate(offset, 0.0f, 0.0f, &temp);
|
||||
|
||||
mat4 proj;
|
||||
mat4_ortho(-range, range, -range, range, shad->z_near, shad->z_far, &proj);
|
||||
mat4_ortho(-shadow_range, shadow_range,
|
||||
-shadow_range, shadow_range, shad->z_near, shad->z_far, &proj);
|
||||
mat4_mul(&proj, &temp, &rctx->proj_mat);
|
||||
mat4_look_at(view_point, interest, &rctx->view_mat);
|
||||
|
||||
@@ -1620,7 +1622,7 @@ static void draw_pass_3d_shadow_set(Shadow* shad) {
|
||||
draw_state->light = true;
|
||||
uniform->arr[U_LIGHT_1] = shad->num_light > 1 ? 1 : 0;
|
||||
|
||||
float_t range = shad->get_range();
|
||||
float_t shadow_range = shad->get_shadow_range();
|
||||
for (int32_t i = 0; i < 2; i++) {
|
||||
float_t offset;
|
||||
vec3* interest;
|
||||
@@ -1643,7 +1645,8 @@ static void draw_pass_3d_shadow_set(Shadow* shad) {
|
||||
mat4_mul_translate(&temp, offset, 0.0f, 0.0f, &temp);
|
||||
|
||||
mat4 proj;
|
||||
mat4_ortho(-range, range, -range, range, shad->z_near, shad->z_far, &proj);
|
||||
mat4_ortho(-shadow_range, shadow_range,
|
||||
-shadow_range, shadow_range, shad->z_near, shad->z_far, &proj);
|
||||
mat4_mul(&proj, &temp, &proj);
|
||||
|
||||
mat4 view;
|
||||
@@ -1670,11 +1673,8 @@ static void draw_pass_3d_shadow_set(Shadow* shad) {
|
||||
vec4 ambient;
|
||||
if (data->get_type() == LIGHT_PARALLEL)
|
||||
data->get_ambient(ambient);
|
||||
else {
|
||||
ambient.x = shad->ambient;
|
||||
ambient.y = shad->ambient;
|
||||
ambient.z = shad->ambient;
|
||||
}
|
||||
else
|
||||
*(vec3*)&ambient.x = shad->shadow_ambient;
|
||||
|
||||
rctx->obj_scene.g_shadow_ambient = { ambient.x, ambient.y, ambient.z, 1.0f };
|
||||
rctx->obj_scene.g_shadow_ambient1 = { 1.0f - ambient.x, 1.0f - ambient.y, 1.0f - ambient.z, 0.0f };
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace rndr {
|
||||
int32_t show_vector_flags;
|
||||
float_t show_vector_length;
|
||||
float_t show_vector_z_offset;
|
||||
bool field_2F8;
|
||||
bool show_stage_shadow;
|
||||
prj::list<draw_pre_process> pre_process;
|
||||
texture* effect_texture;
|
||||
int32_t npr_param;
|
||||
|
||||
@@ -10,8 +10,8 @@ Shadow** shadow_ptr = (Shadow**)0x000000014CC587B8;
|
||||
void(FASTCALL* sub_1405E8A20)(Shadow* shad, int32_t index, vec3* pos)
|
||||
= (void(FASTCALL*)(Shadow* shad, int32_t index, vec3 * pos))0x000000014063FA90;
|
||||
|
||||
float_t Shadow::get_range() {
|
||||
return range * view_region;
|
||||
float_t Shadow::get_shadow_range() {
|
||||
return shadow_range * shadow_range_factor;
|
||||
}
|
||||
|
||||
Shadow* shadow_ptr_get() {
|
||||
|
||||
@@ -22,8 +22,8 @@ struct Shadow {
|
||||
void* __vftable;
|
||||
RenderTexture render_textures[7];
|
||||
RenderTexture* curr_render_textures[3];
|
||||
float_t view_region;
|
||||
float_t range;
|
||||
float_t shadow_range;
|
||||
float_t shadow_range_factor;
|
||||
vec3 view_point[2];
|
||||
vec3 interest[2];
|
||||
vec3 field_1A8[2];
|
||||
@@ -49,15 +49,15 @@ struct Shadow {
|
||||
float_t field_2D8;
|
||||
float_t field_2DC;
|
||||
float_t field_2E0;
|
||||
float_t ambient;
|
||||
bool field_2E8;
|
||||
float_t shadow_ambient;
|
||||
bool show_texture;
|
||||
int32_t num_light;
|
||||
bool light_enable[2];
|
||||
bool self_shadow;
|
||||
bool blur_filter_enable[2];
|
||||
bool separate;
|
||||
|
||||
float_t get_range();
|
||||
float_t get_shadow_range();
|
||||
};
|
||||
|
||||
static_assert(sizeof(Shadow) == 0x2F8, "\"Shadow\" struct should have a size of 0x2F8");
|
||||
|
||||
@@ -181,11 +181,11 @@ static bool object_bounding_sphere_check_visibility_shadow(obj_bounding_sphere*
|
||||
float_t radius = sphere->radius;
|
||||
|
||||
Shadow* shad = shadow_ptr_get();
|
||||
float_t v9 = shad->view_region * shad->range;
|
||||
if ((center.x + radius) < -v9
|
||||
|| (center.x - radius) > v9
|
||||
|| (center.y + radius) < -v9
|
||||
|| (center.y - radius) > v9
|
||||
float_t shadow_range = shad->get_shadow_range();
|
||||
if ((center.x + radius) < -shadow_range
|
||||
|| (center.x - radius) > shadow_range
|
||||
|| (center.y + radius) < -shadow_range
|
||||
|| (center.y - radius) > shadow_range
|
||||
|| (center.z - radius) > -shad->z_near
|
||||
|| (center.z + radius) < -shad->z_far)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user