Fixed incorrect Glitter disp
This commit is contained in:
@@ -38,23 +38,22 @@ namespace Glitter {
|
||||
|
||||
vbo = {};
|
||||
vbo.Create(buffer_size * (size_t)max_count);
|
||||
vbo.Bind();
|
||||
vbo.Bind(true);
|
||||
|
||||
if (is_quad) {
|
||||
size_t count = (size_t)max_count / 4 * 5;
|
||||
int32_t* ebo_data = (int32_t*)_operator_new(sizeof(int32_t) * (count - 1));
|
||||
for (size_t i = 0, j = 0, k = count / 5 - 1; i < count; i += 5, j += 4, k--) {
|
||||
uint32_t* ebo_data = (uint32_t*)_operator_new(sizeof(uint32_t) * count);
|
||||
for (size_t i = 0, j = 0, k = count; k; i += 5, j += 4, k -= 5) {
|
||||
ebo_data[i + 0] = (uint32_t)(j + 0);
|
||||
ebo_data[i + 1] = (uint32_t)(j + 1);
|
||||
ebo_data[i + 2] = (uint32_t)(j + 3);
|
||||
ebo_data[i + 3] = (uint32_t)(j + 2);
|
||||
if (k)
|
||||
ebo_data[i + 4] = 0xFFFFFFFF;
|
||||
ebo_data[i + 4] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
ebo = {};
|
||||
ebo.Create(sizeof(uint16_t) * count, ebo_data);
|
||||
ebo.Bind();
|
||||
ebo.Create(sizeof(uint32_t) * count, ebo_data);
|
||||
ebo.Bind(true);
|
||||
_operator_delete(ebo_data);
|
||||
}
|
||||
else
|
||||
@@ -124,14 +123,6 @@ namespace Glitter {
|
||||
*(uint64_t*)&buf[0x05] = (uint64_t)RenderGroup::DeleteBuffer;
|
||||
inject_data((void*)0x00000001403A8552, buf, 0x11);
|
||||
|
||||
// RenderScene
|
||||
buf[0x00] = 0x48;
|
||||
buf[0x01] = 0xB8;
|
||||
*(uint64_t*)&buf[0x02] = (uint64_t)RenderScene::Disp;
|
||||
buf[0x0A] = 0xFF;
|
||||
buf[0x0B] = 0xE0;
|
||||
inject_data((void*)0x00000001403AA140, buf, 0x0C);
|
||||
|
||||
// GltParticleManager
|
||||
inject_uint64_t((void*)(0x00000001409EB880 + 0x20), (uint64_t)GltParticleManager::Disp);
|
||||
}
|
||||
|
||||
@@ -248,8 +248,11 @@ namespace Glitter {
|
||||
int32_t ctrl_locus;
|
||||
int32_t ctrl_line;
|
||||
|
||||
static void CalcDisp(RenderScene* rend_sc);
|
||||
static void CalcDisp(RenderScene* rend_sc, RenderGroup* rend_group);
|
||||
void CalcDisp();
|
||||
void CalcDisp(RenderGroup* rend_group);
|
||||
void Disp(Glitter::DispType disp_type);
|
||||
void Disp(RenderGroup* rend_group);
|
||||
|
||||
static void CalcDispLine(RenderGroup* rend_group);
|
||||
static void CalcDispLocus(RenderGroup* rend_group);
|
||||
static void CalcDispQuad(RenderGroup* rend_group);
|
||||
@@ -257,7 +260,6 @@ namespace Glitter {
|
||||
RenderGroup* rend_group, mat4* model_mat, mat4* dir_mat);
|
||||
static void CalcDispQuadNormal(
|
||||
RenderGroup* rend_group, mat4* model_mat, mat4* dir_mat);
|
||||
static void Disp(RenderScene* rend_sc, RenderGroup* rend_group);
|
||||
|
||||
static void CalcDispLocusSetPivot(Pivot pivot,
|
||||
float_t w, float_t& v00, float_t& v01);
|
||||
@@ -280,6 +282,8 @@ namespace Glitter {
|
||||
EffectGroup* effect_group;
|
||||
RenderScene render_scene;
|
||||
|
||||
void Disp(DispType disp_type);
|
||||
|
||||
static void CalcDisp(Scene* sc);
|
||||
};
|
||||
|
||||
@@ -308,6 +312,8 @@ namespace Glitter {
|
||||
int32_t counter;
|
||||
int32_t field_104;
|
||||
|
||||
void DispScenes(DispType disp_type);
|
||||
|
||||
static void Disp(GPM);
|
||||
};
|
||||
|
||||
@@ -320,6 +326,4 @@ namespace Glitter {
|
||||
extern void DeleteBuffer(GLuint& vao, GLArrayBuffer& vbo, GLElementArrayBuffer& ebo);
|
||||
|
||||
extern void Patch();
|
||||
|
||||
extern void (FASTCALL* GltParticleManager__DispScenes)(GPM, DispType disp_type);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,20 @@
|
||||
namespace Glitter {
|
||||
GPM = (GltParticleManager*)0x000000141199BB0;
|
||||
|
||||
void GltParticleManager::DispScenes(DispType disp_type) {
|
||||
if (flags & PARTICLE_MANAGER_NOT_DISP)
|
||||
return;
|
||||
|
||||
for (Scene*& i : scenes)
|
||||
if (i)
|
||||
i->Disp(disp_type);
|
||||
|
||||
gl_state_bind_vertex_array(0);
|
||||
gl_state_disable_blend();
|
||||
gl_state_enable_cull_face();
|
||||
gl_state_disable_depth_test();
|
||||
}
|
||||
|
||||
void GltParticleManager::Disp(GPM) {
|
||||
if (glt_particle_manager->flags & PARTICLE_MANAGER_NOT_DISP)
|
||||
return;
|
||||
@@ -17,7 +31,4 @@ namespace Glitter {
|
||||
if (i)
|
||||
Scene::CalcDisp(i);
|
||||
}
|
||||
|
||||
void (FASTCALL* GltParticleManager__DispScenes)(GPM, DispType disp_type)
|
||||
= (void (FASTCALL*)(GPM, DispType disp_type))0x00000001403A1020;
|
||||
}
|
||||
|
||||
+187
-175
@@ -10,15 +10,15 @@
|
||||
#include "../wrap.hpp"
|
||||
|
||||
namespace Glitter {
|
||||
void RenderScene::CalcDisp(RenderScene* rend_sc) {
|
||||
rend_sc->disp_quad = 0;
|
||||
rend_sc->disp_line = 0;
|
||||
rend_sc->disp_locus = 0;
|
||||
void RenderScene::CalcDisp() {
|
||||
disp_quad = 0;
|
||||
disp_line = 0;
|
||||
disp_locus = 0;
|
||||
|
||||
bool (FASTCALL * RenderGroup_CannotDisp)(RenderGroup * rend_group)
|
||||
= (bool(FASTCALL*)(RenderGroup * rend_group))0x00000001403A7120;
|
||||
|
||||
for (RenderGroup*& i : rend_sc->render_groups) {
|
||||
for (RenderGroup*& i : render_groups) {
|
||||
if (!i)
|
||||
continue;
|
||||
|
||||
@@ -26,11 +26,11 @@ namespace Glitter {
|
||||
if (RenderGroup_CannotDisp(rend_group))
|
||||
continue;
|
||||
|
||||
CalcDisp(rend_sc, rend_group);
|
||||
CalcDisp(rend_group);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderScene::CalcDisp(RenderScene* rend_sc, RenderGroup* rend_group) {
|
||||
void RenderScene::CalcDisp(RenderGroup* rend_group) {
|
||||
rend_group->disp = 0;
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
@@ -38,25 +38,202 @@ namespace Glitter {
|
||||
return;
|
||||
|
||||
CalcDispQuad(rend_group);
|
||||
rend_sc->disp_quad += (uint32_t)rend_group->disp;
|
||||
disp_quad += (uint32_t)rend_group->disp;
|
||||
break;
|
||||
case PARTICLE_LINE:
|
||||
if (!rend_group->vao)
|
||||
return;
|
||||
|
||||
CalcDispLine(rend_group);
|
||||
rend_sc->disp_line += (uint32_t)rend_group->disp;
|
||||
disp_line += (uint32_t)rend_group->disp;
|
||||
break;
|
||||
case PARTICLE_LOCUS:
|
||||
if (!rend_group->vao)
|
||||
return;
|
||||
|
||||
CalcDispLocus(rend_group);
|
||||
rend_sc->disp_locus += (uint32_t)rend_group->disp;
|
||||
disp_locus += (uint32_t)rend_group->disp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Glitter::RenderScene::Disp(Glitter::DispType disp_type) {
|
||||
bool (FASTCALL * RenderGroup_CannotDisp)(RenderGroup * rend_group)
|
||||
= (bool(FASTCALL*)(RenderGroup * rend_group))0x00000001403A7120;
|
||||
|
||||
for (RenderGroup*& i : render_groups) {
|
||||
if (!i)
|
||||
continue;
|
||||
|
||||
RenderGroup* rend_group = i;
|
||||
if (RenderGroup_CannotDisp(rend_group) && rend_group->disp_type != disp_type)
|
||||
continue;
|
||||
|
||||
Disp(rend_group);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderScene::Disp(RenderGroup* rend_group) {
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
case PARTICLE_LINE:
|
||||
case PARTICLE_LOCUS:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rend_group->vao || rend_group->disp < 1)
|
||||
return;
|
||||
|
||||
mat4 cam_view;
|
||||
mat4 cam_projection;
|
||||
mat4_transpose(&camera_data->view, &cam_view);
|
||||
mat4_transpose(&camera_data->projection, &cam_projection);
|
||||
|
||||
mat4 mat;
|
||||
mat4_transpose(&rend_group->mat_draw, &mat);
|
||||
mat4_mul(&mat, &cam_view, &mat);
|
||||
mat4_mul(&mat, &cam_projection, &mat);
|
||||
|
||||
float_t emission = 1.0f;
|
||||
if (rend_group->flags & PARTICLE_EMISSION || rend_group->blend_mode == PARTICLE_BLEND_TYPICAL)
|
||||
emission = rend_group->emission;
|
||||
|
||||
glitter_batch_shader_data shader_data = {};
|
||||
mat4_transpose(&mat, &mat);
|
||||
shader_data.g_mvp[0] = mat.row0;
|
||||
shader_data.g_mvp[1] = mat.row1;
|
||||
shader_data.g_mvp[2] = mat.row2;
|
||||
shader_data.g_mvp[3] = mat.row3;
|
||||
shader_data.g_glitter_blend_color = 1.0f;
|
||||
shader_data.g_state_material_diffuse = 0.0f;
|
||||
shader_data.g_state_material_emission = { emission, emission, emission, 1.0f };
|
||||
rctx->glitter_batch_ubo.WriteMemory(shader_data);
|
||||
|
||||
GLenum blend_src = GL_SRC_ALPHA;
|
||||
GLenum blend_dst = GL_ONE_MINUS_SRC_ALPHA;
|
||||
switch (rend_group->blend_mode) {
|
||||
case PARTICLE_BLEND_ADD:
|
||||
blend_src = GL_SRC_ALPHA;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
case PARTICLE_BLEND_MULTIPLY:
|
||||
blend_src = GL_ZERO;
|
||||
blend_dst = GL_SRC_COLOR;
|
||||
break;
|
||||
}
|
||||
|
||||
gl_state_enable_blend();
|
||||
gl_state_set_blend_func(blend_src, blend_dst);
|
||||
gl_state_set_blend_equation(GL_FUNC_ADD);
|
||||
|
||||
GLuint texture = rctx->empty_texture_2d;
|
||||
GLuint mask_texture = rctx->empty_texture_2d;
|
||||
if (rend_group->type != PARTICLE_LINE && rend_group->texture) {
|
||||
texture = rend_group->texture;
|
||||
if (rend_group->mask_texture) {
|
||||
mask_texture = rend_group->mask_texture;
|
||||
|
||||
uniform->arr[U_TEXTURE_COUNT] = 2;
|
||||
switch (rend_group->mask_blend_mode) {
|
||||
default:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
break;
|
||||
case PARTICLE_BLEND_MULTIPLY:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 1;
|
||||
break;
|
||||
case PARTICLE_BLEND_ADD:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_TEXTURE_COUNT] = 1;
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_TEXTURE_COUNT] = 0;
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
}
|
||||
|
||||
gl_state_active_bind_texture_2d(0, texture);
|
||||
gl_state_active_bind_texture_2d(1, mask_texture);
|
||||
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
switch (rend_group->fog_type) {
|
||||
default:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
break;
|
||||
case Glitter::FOG_DEPTH:
|
||||
uniform->arr[U_FOG_HEIGHT] = 1;
|
||||
break;
|
||||
case Glitter::FOG_HEIGHT:
|
||||
uniform->arr[U_FOG_HEIGHT] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rend_group->blend_mode == PARTICLE_BLEND_PUNCH_THROUGH) {
|
||||
uniform->arr[U_ALPHA_BLEND] = 1;
|
||||
gl_state_enable_depth_test();
|
||||
gl_state_set_depth_mask(GL_TRUE);
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_ALPHA_BLEND] = rend_group->disp_type ? 2 : 0;
|
||||
gl_state_enable_depth_test();
|
||||
gl_state_set_depth_mask(GL_FALSE);
|
||||
}
|
||||
|
||||
if (rend_group->draw_type == DIRECTION_BILLBOARD) {
|
||||
gl_state_enable_cull_face();
|
||||
gl_state_set_cull_face_mode(GL_BACK);
|
||||
}
|
||||
else
|
||||
gl_state_disable_cull_face();
|
||||
break;
|
||||
case PARTICLE_LINE:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
uniform->arr[U_ALPHA_BLEND] = 2;
|
||||
|
||||
gl_state_enable_depth_test();
|
||||
gl_state_set_depth_mask(GL_FALSE);
|
||||
gl_state_enable_cull_face();
|
||||
gl_state_set_cull_face_mode(GL_BACK);
|
||||
break;
|
||||
case PARTICLE_LOCUS:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
uniform->arr[U_ALPHA_BLEND] = 2;
|
||||
|
||||
gl_state_enable_depth_test();
|
||||
gl_state_set_depth_mask(GL_FALSE);
|
||||
gl_state_disable_cull_face();
|
||||
break;
|
||||
}
|
||||
|
||||
shaders_ft.set(SHADER_FT_GLITTER_PT);
|
||||
rctx->obj_scene_ubo.Bind(0);
|
||||
rctx->glitter_batch_ubo.Bind(2);
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
gl_state_bind_vertex_array(rend_group->vao);
|
||||
shaders_ft.enable_primitive_restart();
|
||||
shaders_ft.draw_elements(GL_TRIANGLE_STRIP, (GLsizei)(5 * rend_group->disp - 1), GL_UNSIGNED_INT, 0);
|
||||
shaders_ft.disable_primitive_restart();
|
||||
break;
|
||||
case PARTICLE_LINE:
|
||||
gl_state_bind_vertex_array(rend_group->vao);
|
||||
for (std::pair<GLint, GLsizei>& i : *rend_group->draw_list)
|
||||
shaders_ft.draw_arrays(GL_LINE_STRIP, i.first, i.second);
|
||||
break;
|
||||
case PARTICLE_LOCUS:
|
||||
gl_state_bind_vertex_array(rend_group->vao);
|
||||
for (std::pair<GLint, GLsizei>& i : *rend_group->draw_list)
|
||||
shaders_ft.draw_arrays(GL_TRIANGLE_STRIP, i.first, i.second);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void RenderScene::CalcDispLine(RenderGroup* rend_group) {
|
||||
if (!rend_group->elements || rend_group->vbo.IsNull() || rend_group->ctrl < 1)
|
||||
return;
|
||||
@@ -729,171 +906,6 @@ namespace Glitter {
|
||||
rend_group->vbo.UnmapMemory();
|
||||
}
|
||||
|
||||
void RenderScene::Disp(RenderScene* rend_sc, RenderGroup* rend_group) {
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
case PARTICLE_LINE:
|
||||
case PARTICLE_LOCUS:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rend_group->vao || rend_group->disp < 1)
|
||||
return;
|
||||
|
||||
mat4 cam_view;
|
||||
mat4 cam_projection;
|
||||
mat4_transpose(&camera_data->view, &cam_view);
|
||||
mat4_transpose(&camera_data->projection, &cam_projection);
|
||||
|
||||
mat4 mat;
|
||||
mat4_transpose(&rend_group->mat_draw, &mat);
|
||||
mat4_mul(&mat, &cam_view, &mat);
|
||||
mat4_mul(&mat, &cam_projection, &mat);
|
||||
|
||||
float_t emission = 1.0f;
|
||||
if (rend_group->flags & PARTICLE_EMISSION || rend_group->blend_mode == PARTICLE_BLEND_TYPICAL)
|
||||
emission = rend_group->emission;
|
||||
|
||||
glitter_batch_shader_data shader_data = {};
|
||||
mat4_transpose(&mat, &mat);
|
||||
shader_data.g_mvp[0] = mat.row0;
|
||||
shader_data.g_mvp[1] = mat.row1;
|
||||
shader_data.g_mvp[2] = mat.row2;
|
||||
shader_data.g_mvp[3] = mat.row3;
|
||||
shader_data.g_glitter_blend_color = 1.0f;
|
||||
shader_data.g_state_material_diffuse = 0.0f;
|
||||
shader_data.g_state_material_emission = { emission, emission, emission, 1.0f };
|
||||
rctx->glitter_batch_ubo.WriteMemory(shader_data);
|
||||
|
||||
GLenum blend_src = GL_SRC_ALPHA;
|
||||
GLenum blend_dst = GL_ONE_MINUS_SRC_ALPHA;
|
||||
switch (rend_group->blend_mode) {
|
||||
case PARTICLE_BLEND_ADD:
|
||||
blend_src = GL_SRC_ALPHA;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
case PARTICLE_BLEND_MULTIPLY:
|
||||
blend_src = GL_ZERO;
|
||||
blend_dst = GL_SRC_COLOR;
|
||||
break;
|
||||
}
|
||||
|
||||
gl_state_enable_blend(true);
|
||||
gl_state_set_blend_func(blend_src, blend_dst, true);
|
||||
gl_state_set_blend_equation(GL_FUNC_ADD, true);
|
||||
|
||||
GLuint texture = rctx->empty_texture_2d;
|
||||
GLuint mask_texture = rctx->empty_texture_2d;
|
||||
if (rend_group->type != PARTICLE_LINE && rend_group->texture) {
|
||||
texture = rend_group->texture;
|
||||
if (rend_group->mask_texture) {
|
||||
mask_texture = rend_group->mask_texture;
|
||||
|
||||
uniform->arr[U_TEXTURE_COUNT] = 2;
|
||||
switch (rend_group->mask_blend_mode) {
|
||||
default:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
break;
|
||||
case PARTICLE_BLEND_MULTIPLY:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 1;
|
||||
break;
|
||||
case PARTICLE_BLEND_ADD:
|
||||
uniform->arr[U_TEXTURE_BLEND] = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_TEXTURE_COUNT] = 1;
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_TEXTURE_COUNT] = 0;
|
||||
uniform->arr[U_TEXTURE_BLEND] = 0;
|
||||
}
|
||||
|
||||
gl_state_active_bind_texture_2d(0, texture, true);
|
||||
gl_state_active_bind_texture_2d(1, mask_texture, true);
|
||||
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
switch (rend_group->fog_type) {
|
||||
default:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
break;
|
||||
case Glitter::FOG_DEPTH:
|
||||
uniform->arr[U_FOG_HEIGHT] = 1;
|
||||
break;
|
||||
case Glitter::FOG_HEIGHT:
|
||||
uniform->arr[U_FOG_HEIGHT] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rend_group->blend_mode == PARTICLE_BLEND_PUNCH_THROUGH) {
|
||||
uniform->arr[U_ALPHA_BLEND] = 1;
|
||||
gl_state_enable_depth_test(true);
|
||||
gl_state_set_depth_mask(GL_TRUE, true);
|
||||
}
|
||||
else {
|
||||
uniform->arr[U_ALPHA_BLEND] = rend_group->disp_type ? 2 : 0;
|
||||
gl_state_enable_depth_test(true);
|
||||
gl_state_set_depth_mask(GL_FALSE, true);
|
||||
}
|
||||
|
||||
if (rend_group->draw_type == DIRECTION_BILLBOARD) {
|
||||
gl_state_enable_cull_face(true);
|
||||
gl_state_set_cull_face_mode(GL_BACK, true);
|
||||
}
|
||||
else
|
||||
gl_state_disable_cull_face(true);
|
||||
break;
|
||||
case PARTICLE_LINE:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
uniform->arr[U_ALPHA_BLEND] = 2;
|
||||
|
||||
gl_state_enable_depth_test(true);
|
||||
gl_state_set_depth_mask(GL_FALSE, true);
|
||||
gl_state_enable_cull_face(true);
|
||||
gl_state_set_cull_face_mode(GL_BACK, true);
|
||||
break;
|
||||
case PARTICLE_LOCUS:
|
||||
uniform->arr[U_FOG_HEIGHT] = 0;
|
||||
uniform->arr[U_ALPHA_BLEND] = 2;
|
||||
|
||||
gl_state_enable_depth_test(true);
|
||||
gl_state_set_depth_mask(GL_FALSE, true);
|
||||
gl_state_disable_cull_face(true);
|
||||
break;
|
||||
}
|
||||
|
||||
shaders_ft.set(SHADER_FT_GLITTER_PT);
|
||||
rctx->glitter_batch_ubo.Bind(2);
|
||||
switch (rend_group->type) {
|
||||
case PARTICLE_QUAD:
|
||||
gl_state_bind_vertex_array(rend_group->vao, true);
|
||||
shaders_ft.enable_primitive_restart();
|
||||
shaders_ft.draw_elements(GL_TRIANGLE_STRIP, (GLsizei)(5 * rend_group->disp - 1), GL_UNSIGNED_INT, 0);
|
||||
shaders_ft.disable_primitive_restart();
|
||||
gl_state_bind_vertex_array(0);
|
||||
break;
|
||||
case PARTICLE_LINE:
|
||||
case PARTICLE_LOCUS:
|
||||
gl_state_bind_vertex_array(rend_group->vao, true);
|
||||
DrawListData& draw_list = *rend_group->draw_list;
|
||||
if (rend_group->type == PARTICLE_LINE)
|
||||
for (prj::pair<GLint, GLsizei>& i : draw_list)
|
||||
shaders_ft.draw_arrays(GL_LINE_STRIP, i.first, i.second);
|
||||
else
|
||||
for (prj::pair<GLint, GLsizei>& i : draw_list)
|
||||
shaders_ft.draw_arrays(GL_TRIANGLE_STRIP, i.first, i.second);
|
||||
gl_state_bind_vertex_array(0);
|
||||
break;
|
||||
}
|
||||
shaders_ft.set(-1);
|
||||
}
|
||||
|
||||
void RenderScene::CalcDispLocusSetPivot(Pivot pivot,
|
||||
float_t w, float_t& v00, float_t& v01) {
|
||||
switch (pivot) {
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
#include "../gl_state.hpp"
|
||||
|
||||
namespace Glitter {
|
||||
void Scene::Disp(DispType disp_type) {
|
||||
if (!(flags & SCENE_NOT_DISP))
|
||||
render_scene.Disp(disp_type);
|
||||
}
|
||||
|
||||
void Scene::CalcDisp(Scene* sc) {
|
||||
if (!(sc->flags & SCENE_NOT_DISP))
|
||||
RenderScene::CalcDisp(&sc->render_scene);
|
||||
sc->render_scene.CalcDisp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ namespace rndr {
|
||||
gl_state_disable_depth_test();
|
||||
}
|
||||
|
||||
Glitter::GltParticleManager__DispScenes(Glitter::glt_particle_manager, Glitter::DISP_OPAQUE);
|
||||
Glitter::glt_particle_manager->DispScenes(Glitter::DISP_OPAQUE);
|
||||
|
||||
gl_state_enable_depth_test();
|
||||
gl_state_set_depth_mask(GL_TRUE);
|
||||
@@ -748,7 +748,7 @@ namespace rndr {
|
||||
gl_state_disable_depth_test();
|
||||
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
|
||||
Glitter::GltParticleManager__DispScenes(Glitter::glt_particle_manager, Glitter::DISP_ALPHA);
|
||||
Glitter::glt_particle_manager->DispScenes(Glitter::DISP_ALPHA);
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
|
||||
/*if (npr_param == 1) {
|
||||
@@ -770,7 +770,7 @@ namespace rndr {
|
||||
}
|
||||
|
||||
//gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); // X
|
||||
//Glitter::GltParticleManager__DispScenes(Glitter::glt_particle_manager, Glitter::DISP_TYPE_2);
|
||||
//Glitter::glt_particle_manager->DispScenes(Glitter::DISP_TYPE_2);
|
||||
//gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
|
||||
gl_state_set_depth_mask(GL_TRUE);
|
||||
@@ -784,7 +784,7 @@ namespace rndr {
|
||||
gl_state_disable_depth_test();
|
||||
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
|
||||
Glitter::GltParticleManager__DispScenes(Glitter::glt_particle_manager, Glitter::DISP_NORMAL);
|
||||
Glitter::glt_particle_manager->DispScenes(Glitter::DISP_NORMAL);
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
|
||||
gl_state_enable_depth_test();
|
||||
@@ -797,11 +797,10 @@ namespace rndr {
|
||||
mdl::OBJ_TYPE_TRANSPARENT_ALPHA_ORDER_1,
|
||||
mdl::OBJ_TYPE_TRANSLUCENT_ALPHA_ORDER_1);
|
||||
|
||||
#if defined(CRE_DEV)
|
||||
#if (0)
|
||||
if (Glitter::glt_particle_manager->CheckHasLocalEffect()) { // X
|
||||
camera* cam = camera_data;
|
||||
double_t fov = cam->get_fov();
|
||||
cam->set_fov(32.2673416137695);
|
||||
float_t fov = camera_data->fov;
|
||||
camera_data->fov = 32.2673416137695f;
|
||||
draw_pass_set_camera();
|
||||
|
||||
rctx->obj_scene_ubo.WriteMemory(rctx->obj_scene);
|
||||
@@ -821,9 +820,9 @@ namespace rndr {
|
||||
mdl::OBJ_TYPE_TRANSLUCENT_ALPHA_ORDER_2_LOCAL);
|
||||
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
|
||||
Glitter::GltParticleManager__DispScenes(Glitter::glt_particle_manager, Glitter::DISP_LOCAL);
|
||||
Glitter::glt_particle_manager->DispScenes(Glitter::DISP_LOCAL);
|
||||
gl_state_set_color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
cam->set_fov(fov);
|
||||
camera_data->fov = fov;
|
||||
draw_pass_set_camera();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user