Hello there! I’m creating a water block and I want to prevent the sides of the block from being rendered when they’re next to another water block.
Well if you go with @JohnK’s suggestion from this thread:
You could always have a transparent section in your texture, and then change the UVs of the touching faces to the transparent section in the texture.
Sorry, I’ve forgotten about that…
But wait, how can I detect when a side is next to another water block?
I’m guessing you have all the pieces necessary to write a small bit of logic to figure this out.
You know what each cube type is correct? And you know how big each block is? And you know the position of each block? So if 2 water blocks are next to each other, then you know which sides of which blocks to change the UVs of.
I’m able to do that in this debug scene. But in a generated world, I don’t know.
What do you mean by debug scene?
In a generated world, you still know the position, size, and type of each block don’t you?
I want to use noise to generate a terrain and I’m still fingering out things.
Cool sounds like a fantastic project!
Check out this video tutorial on creating procedural terrain with noise.
Sounds like you’ll then use the procedural terrain to translate into block locations. Fun idea!!!
At some point I imagine you’ll still need some type of data to represent the block locations. You can use that as the base to figure out relationships between the blocks like in the water block example you’re trying to solve. Fun stuff
Thanks, that will be very helpful.