Shadoh Posted June 29, 2014 Posted June 29, 2014 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 What's the correct way of doing that? Also, adding the terrain object to the documentation would be awesome Quote
Ma-Shell Posted June 29, 2014 Posted June 29, 2014 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. 1 Quote
shadmar Posted June 29, 2014 Posted June 29, 2014 The index is used to access next surface if your model have 2 surfaces, the second one would be surface[1] Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB
Ma-Shell Posted June 29, 2014 Posted June 29, 2014 @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)? Quote
Recommended Posts
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.