chore: 删除冗余上传、遗留代码
parent
4f39cba9cd
commit
232f77deb3
Binary file not shown.
|
|
@ -20,7 +20,6 @@ layout(local_size_x = 16, local_size_y = 16) in;
|
|||
// G-Buffer inputs
|
||||
layout(binding = 0, rgba32f) uniform readonly image2D g_position;
|
||||
layout(binding = 1, rgba32f) uniform readonly image2D g_normal;
|
||||
layout(binding = 2, rgba8) uniform readonly image2D g_albedo;
|
||||
|
||||
// Material params + material id (for primary hit fast-path)
|
||||
layout(binding = 5, rgba32f) uniform readonly image2D g_material;
|
||||
|
|
|
|||
|
|
@ -182,7 +182,6 @@ void GBuffer::render(const Scene &scene, const Shader &shader) {
|
|||
shader.set_float("u_roughness", material->get_roughness());
|
||||
shader.set_uint("u_material_id", material_id);
|
||||
shader.set_float("u_ior", material->get_ior());
|
||||
shader.set_vec3("u_emission", material->get_emission());
|
||||
shader.set_uint("u_material_type", static_cast<uint>(material->get_type()));
|
||||
|
||||
// Bind textures
|
||||
|
|
@ -194,15 +193,6 @@ void GBuffer::render(const Scene &scene, const Shader &shader) {
|
|||
} else {
|
||||
shader.set_int("u_has_albedo_map", 0);
|
||||
}
|
||||
|
||||
auto normal_tex = material->get_normal_texture();
|
||||
if (normal_tex && normal_tex->is_valid()) {
|
||||
normal_tex->bind(1);
|
||||
shader.set_int("u_normal_map", 1);
|
||||
shader.set_int("u_has_normal_map", 1);
|
||||
} else {
|
||||
shader.set_int("u_has_normal_map", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw mesh
|
||||
|
|
|
|||
|
|
@ -228,8 +228,6 @@ void RayTracer::trace(const Scene &scene, const GBuffer &gbuffer, TextureHandle
|
|||
|
||||
// Set camera data
|
||||
const Camera &camera = scene.get_camera();
|
||||
compute_shader_->set_vec3("u_camera_position", camera.get_position());
|
||||
|
||||
Mat4 inv_vp = glm::inverse(camera.get_view_projection_matrix());
|
||||
compute_shader_->set_mat4("u_inv_view_projection", inv_vp);
|
||||
|
||||
|
|
@ -405,7 +403,6 @@ void RayTracer::upload_scene_data_(const Scene &scene) {
|
|||
void RayTracer::bind_gbuffer_(const GBuffer &gbuffer) {
|
||||
glBindImageTexture(0, gbuffer.get_texture(GBUFFER_POSITION), 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
|
||||
glBindImageTexture(1, gbuffer.get_texture(GBUFFER_NORMAL), 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
|
||||
glBindImageTexture(2, gbuffer.get_texture(GBUFFER_ALBEDO), 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8);
|
||||
|
||||
glBindImageTexture(5, gbuffer.get_texture(GBUFFER_MATERIAL), 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
|
||||
glBindImageTexture(6, gbuffer.get_texture(GBUFFER_MATERIAL_ID), 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI);
|
||||
|
|
|
|||
Loading…
Reference in New Issue