Skip to content

drawNoise/drawNoiseLayers as an effect so that json can use them#12152

Open
EggleEgg wants to merge 5 commits into
Anuken:masterfrom
EggleEgg:noise-effect-overlay
Open

drawNoise/drawNoiseLayers as an effect so that json can use them#12152
EggleEgg wants to merge 5 commits into
Anuken:masterfrom
EggleEgg:noise-effect-overlay

Conversation

@EggleEgg

Copy link
Copy Markdown
Contributor

Example with a datapatch:

2026-05-30.13-11-58.mp4

If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • I have read the contribution guidelines.
  • I have ensured that my code compiles, if applicable.
  • I have ensured that any new features in this PR function correctly in-game, if applicable.

@Kev-Vily

Copy link
Copy Markdown
Contributor

YO, I'VE AN IDEA


@Override
public void render(EffectContainer e){
Texture tex = Core.assets.get(noisePath, Texture.class);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If you look at the source for get, you'll see that libGDX did something really funny by making it crash instead of return null when the file isn't found. This is obviously a bad idea for effects. I'm adding a getOrNull method to fix this, but this PR will have to wait until that's merged in.

Also, it should be cached so that it only needs to call getOrNull the first time instead of calling it every render.

@EggleEgg EggleEgg marked this pull request as draft May 30, 2026 17:08
@EggleEgg EggleEgg marked this pull request as ready for review June 22, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants