New answers tagged heightmap
I suggest you change the way you render your vertices instead of trying to merge them. You are using immediate rendering. While good for debugging and proof of concept, it is "deprecated", and not a preferrable way to render when it comes to performance. You have several alternatives, but the most versatile and robust way I would recommend is using Vertex ...
Use float or float instead of List[Float] for the map. if you use List[Float] every time you add or get a float value to/from the map Java creates A Float instance form the primitive float value or convert the Float instance to a primitive float value (auto-boxing, -unboxing) this needs more memory and time.
The term you are looking for is multitexturing. For this, you have to send every texture you want to use to the pixel shader, and there decide from some per-vertex weight factor how much each texture will add its value to the final color. For example, if you want to use 4 textures, you add a float4 value to your vertices (I'd call this weight). Then in pixel ...
turns out you have to be careful with your macros #define height(x, y) hmInfo.heightMap[(y*cols) + x].y The y on the end was replaced by the macro Working version #define height(a, b) hmInfo.heightMap[(b*cols) + a].y Im supprised how this compiled and even worked without breaking
Top 50 recent answers are included