Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collision viewer for Jak 1 Custom levels #3813

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion game/graphics/opengl_renderer/OpenGLRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,8 @@ void OpenGLRenderer::dispatch_buckets_jak1(DmaFollower dma,
m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time();

// hack to draw the collision mesh in the middle the drawing
if (bucket_id == 31 - 1 && Gfx::g_global_settings.collision_enable) {
if (bucket_id == (int)jak1::BucketId::MERC_PRIS_LEVEL0 &&
Gfx::g_global_settings.collision_enable) {
Comment on lines -1307 to +1308
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think moving this here will break shadows on the collision geometry but I'm not sure. What if you put GENERIC_ALPHA as the bucket instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
I binary searched the enum and found an entry that "worked" - I did a test through hub 1 and didn't notice any issues after my change but I can do another test and pay attention to shadows specifically.

auto p = prof.make_scoped_child("collision-draw");
m_collide_renderer.render(&m_render_state, p);
}
Expand Down
4 changes: 2 additions & 2 deletions goal_src/jak1/pc/debug/default-menu-pc.gc
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@
(cond
((-> arg value)
(false! (-> arg value))
(logior! *vu1-enable-user-menu* (vu1-renderer-mask tfrag trans-tfrag tie tie-near))
(logior! *vu1-enable-user-menu* (vu1-renderer-mask tfrag tie tie-near))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove trans-tfrag here? Not a big deal either way, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I did my binary search to find out where this worked, the bucket that it draws during is in trans-tfrag, and removing it from this call did not change anything else that I noticed during my testing.
image
image

(true! *generic-tie*))
(else
(true! (-> arg value))
(logclear! *vu1-enable-user-menu* (vu1-renderer-mask tfrag trans-tfrag tie tie-near))
(logclear! *vu1-enable-user-menu* (vu1-renderer-mask tfrag tie tie-near))
(false! *generic-tie*))))
(-> arg value))

Expand Down
2 changes: 1 addition & 1 deletion goalc/build_level/common/gltf_mesh_extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "common/math/geometry.h"
#include "common/util/Timer.h"
#include "common/util/gltf_util.h"
#include <common/util/image_resize.h>
#include "common/util/image_resize.h"

using namespace gltf_util;
constexpr int kColorTreeDepth = 13;
Expand Down
Loading