Jump to content

Recommended Posts

Posted

Hey guys, I'm trying to get the shader for adjusting plane clipping values at runtime.

When I do:

 

Material* Mat = terrain->GetMaterial();

 

I get a null reference sad.png

 

What's the correct way of doing that?

 

Also, adding the terrain object to the documentation would be awesome ;)

Posted

I believe, you have to use the surface. The following doesn't yield NULL:

Material* mat = terrain->surface[0]->GetMaterial();

 

Though I have no idea, what the index is for, maybe this can give you a push to the right direction.

  • Upvote 1
Posted

@shadmar

Yeah, but what actually is a surface? Just a group of vertices? If so, what separates the vertices from one surface from those in another one? Are those just user-defined groups of vertices? So why would a terrain have multiple surfaces ("surface" is defined as an array of 5 within the terrain-class, so this isn't something simply inherited)?

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...