Jump to content

[1.18.2] How to darken blocks en masse


SoLegendary

Recommended Posts

I want to have a fog-of-war feature that classic RTS games have by darkening blocks (separate to their in-world brightness) which are out of range of the player to varying degrees:

  • No change for in range,
  • Medium dark for out of range but previously explored,
  • Very dark/black for out of range and unexplored

An example of what I mean from Starcraft would be this:

https://blog.gemserk.com/wp-content/uploads/2018/08/SCScrnShot_082518_153611-1024x768.png

I want this darkening to apply to ALL blocks in view of the camera (I have a top-down camera in my mod so it's not that many blocks) so I need a solution that is relatively low-performance. My immediately thought of course is shaders and texture packs, except as far as I know those cannot be applied conditionally from code. I also don't want to mess with block world brightness so that light sources can still be seen properly in the fog of war.

EDIT: just found this page on the community wiki: https://forge.gemwire.uk/wiki/Tinted_Textures. Would it be possible to manipulate these tint textures to apply the darkening I need (preferably without impacting any original tinting conditions like grass blocks changing colour in specific biomes)

Edited by SoLegendary
tints?
Link to comment
Share on other sites

On 5/3/2022 at 3:36 PM, SoLegendary said:

Would it be possible to manipulate these tint textures to apply the darkening I need

no, because most blocks don't have that.

if you make a plant block, your model will likely consist of two parts: fixed color part (part that is not green: berries of flowers) and tinted part (texture will be gray but the game will make it match biome's shade of green).
so, no.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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