Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.19.2] [Solved] How to apply a custom shader to all blocks in a specific chunk?

Featured Replies

Posted

I've been playing around with how chunk rendering works, and found how to conditionally render specific chunks with this code:

https://pastebin.com/5UzA0s1F

This code prevents the rendering of all chunks outside of a 30 block radius around a specific mob type. However, my end goal is to just apply a shader to show those chunks are out of range, rather than just not render them at all - something simple like painting them all black or changing it to monochrome. I believe I'd have to write a fragment shader (.fsh) for this which I've done before but only in isolation, playing around with this editor here: https://patriciogonzalezvivo.github.io/glslEditor/. I am assuming here that the shader I write can get an input of the original colour of each pixel which I can then modify.

Does Forge provide this compatibility and if so, how can I go about registering and applying the shader in code once it's been written?

Also, I don't think I'm going worry about rendering entities or block entities in these "dark" chunks so hopefully that simplifies this.

EDIT: nevermind, I found a solution that doesn't require shaders - since I just want to darken the chunks and not apply any complex effects, I realised I can just mixin ModelBlockRenderer and change the lightmap values.

Edited by SoLegendary

  • SoLegendary changed the title to [1.19.2] [Solved] How to apply a custom shader to all blocks in a specific chunk?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.