0 votes

I'm trying to make a game that's like Wolfenstein 3D. In Wolf 3D, all of the walls that are facing north/south are darker than the ones that are facing east/west. I would like to add a similar effect to my game.

Wolf 3D accomplishes this effect by storing two separate textures for each tile. I would like to only store one texture for each tile. In order to apply one texture to every face of a cube, I've created a SpatialMaterial who's uv1_scale is Vector3(3, 2, 1). To create the darkening effect, I used a detail texture who's Blend Mode is set to Mul.

Here's the issue: uv1_scale is being applied to the detail texture. Setting detail_uv_layer to UV2 doesn't seem to change anything. What is detail_uv_layer supposed to do?

Here's a minimum reproduction project. scenes/six_faces.tscn shows off the effect that I'm looking for, but it stores the face six times. scenes/one_face.tscn shows off what I'm trying to do to achieve the effect while only storing the texture once.

Godot version v3.2.3.stable.official
in Engine by (369 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.