Skip to content

MetaDrive: Rendering images into the 3D environment #707

Answered by QuanyiLi
alexander-toch asked this question in Q&A
Discussion options

You must be logged in to vote

Ahh, I see. That's interesting. First, You need to modify this function:

def get_terrain_semantics(self, center_point):
You have to put a new semantic class to the generated semantic_map, which tells the terrain about which texture to place at a given place. Then, you need to input your new texture to the shader program so it can be accessed in terrain.frag.glsl. You also new to modify this shader program by

  1. declaring new textures
  2. modify the semantic parse code so your new texture is selected when the semantic class is your target texture class. Just modify here:
  if ((attri.r > 0.01) && (terrain_uv.x>=r_min) 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@alexander-toch
Comment options

@alexander-toch
Comment options

Answer selected by alexander-toch
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants