Question

I'm currently working on a cylinder shaped terrain produced by a height map. What happens in the program is simple, there is a texture for the colors of the terrain that has the alpha value of regions in with i want it to be invisible and another texture ARGB with the A being the gray scale for the heights and RGB is the normal for the light. The texture is such that the A value goes from 1 to 255 and I'm reserving the 0 for the regions with holes, meaning i don't want then to exist. So in theory no problem, I'm making those regions invisible based on the first texture but on practice what's happening is that the program is considering the 0 as the minimum height and, even with the texture on top, is creating some lines towards this regions of 0, like trying to make its triangle but not getting there because i cut the next vertex by making it invisible. Notice the lines going to the center of the cylinder This is how it gets when i stop making those vertex invisible

Notice the lines going to the center of the cylinder This is how it gets when i stop making those vertex invisible

So, just to say, i used the function Clip() on the pixel shader to make it invisible.

Basically what i need of help: Is it possible, the same way i use clip() on the pixel shader i do something like that on the vertex shader and get rid of the unwanted vertex? Basically, is possible to just say to ignore value 0? Any ideas to fix this? i thinking of making all the vertex that are 0 become the value of his neighbor, that way those lines wouldn't go to the center but to the same plane as the cylinder itself. Another thing is that we can see that the program is interpolating the values from one vertex to the next, that is why i cuts on halfway through to the invisible vertex

I'm working with Directx11 API with C++ and the program uses Tessellation.

Thank you for your time and will be very glad with any input on this!

Était-ce utile?

La solution

Well i did resolve a bit of this issue. I made the texture with the height values pass through a modifier that created another texture with the zero values substituted by the side pixel with value different then zero or change for 128.0f. with that it made the weird lines direction be more accurate not going to the center of the cylinder but along the line.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top