Jump to content

Recommended Posts

Posted (edited)

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

Posted

Is there a way to conditionally apply shaders from code onto blocks? I saw this post doing something which could help me for entities

Except it relies on the RenderLivingEvent event and I don't see any equivalent event for block rendering.

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.