Skip to content

Commit

Permalink
Fixed resource reload breaking hand
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocelot5836 committed Nov 12, 2024
1 parent cb3b3a6 commit ef69642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public void addShaders(ObjIntConsumer<ResourceLocation> registry) {
@Override
public void addShaders(ObjIntConsumer<ResourceLocation> registry) {
IntSet programs = new IntOpenHashSet();
for (int i = 0; i < 10000; i++) {
for (int i = 1; i < 10000; i++) {
if (!glIsProgram(i)) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ public static void bind() {
AdvancedFbo mainRenderTarget = postTarget != null ? postTarget : AdvancedFbo.getMainFramebuffer();
int w = mainRenderTarget.getWidth();
int h = mainRenderTarget.getHeight();
int framebufferTexture = mainRenderTarget.getColorTextureAttachment(0).getId();
if (firstPerson == null || firstPerson.getWidth() != w || firstPerson.getHeight() != h) {
free();
firstPerson = AdvancedFbo.withSize(w, h)
.addColorTextureWrapper(mainRenderTarget.getColorTextureAttachment(0).getId())
.addColorTextureWrapper(framebufferTexture)
.setFormat(FramebufferAttachmentDefinition.Format.DEPTH_COMPONENT)
.setDepthTextureBuffer()
.build(true);
}
firstPerson.setColorAttachmentTexture(0, framebufferTexture);
VeilRenderSystem.renderer().getFramebufferManager().setFramebuffer(VeilFramebuffers.FIRST_PERSON, firstPerson);
firstPerson.bind(false);
}
Expand Down

0 comments on commit ef69642

Please sign in to comment.