First i apologize if my english is bad, i’m gonna try to do the least mistakes as possible.
Hello i’m a student and relatively new to c++, here i’m trying to build a voxels field from a Texture2D(the Texture2D is always in two colors, black (R=0,G=0,B=0,A=255) and white (R=255,G=255,B=255,A=255)), I want my code to be able to detect where he is on the texture and to generate the least possible mesh in my scene, for this i read the texture2D and if the pixel is black then i generate his front face, if his left neighbour is black then i don’t generate his left side, same for right side,top and down side, i never generate the back side because we never need to see it. Actually it work for small image but it instantly crash when image is bigger and i don’t understand why, i need help thx in advance, if you need any information or any question ask and i will answer.
Here is the .c++, .h, the build, the error, the base image and the image i want him to take after