How to use S3DVertex2TCoords?
Posted: Sun May 19, 2024 8:18 pm
Im modding Minetest and would like to use S3DVertex2TCoords because I need the extra UVs to pass some extra info to the shader. (Each node needs to have some information about its neighbors so I can tile the connected textures in the shader)
The minetest code is written to use video::S3DVertex. For example
S3DVertex2TCoords inherits from and is an S3DVertex so in theory I should be able to find out where my vertices are being created and change them from S3DVertex to S3DVertex2TCoords.
I don't even care what the value of the extra UV is on creation since Im going to change it later, I just need to make sure the memory exists and will be passed to the shader. The vertices may actually already be S3DVertex2TCoords for all I know Im not even sure how to check since I dont know how exactly vertices are passed to shaders.
But I cant figure out where in Irrlitcht those vertices are being created. Maybe there is a way to save my mesh in Blender with an extra set of UVs and Irrlicht notices these extra uvs and uses S3DVertex2TCoords automatically?
Keep in mind the Minetest version of Irrlicht is far behind the modern version of Irrlicht.
Thank you
The minetest code is written to use video::S3DVertex. For example
Code: Select all
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
int vertex_count = buf->getVertexCount();
I don't even care what the value of the extra UV is on creation since Im going to change it later, I just need to make sure the memory exists and will be passed to the shader. The vertices may actually already be S3DVertex2TCoords for all I know Im not even sure how to check since I dont know how exactly vertices are passed to shaders.
But I cant figure out where in Irrlitcht those vertices are being created. Maybe there is a way to save my mesh in Blender with an extra set of UVs and Irrlicht notices these extra uvs and uses S3DVertex2TCoords automatically?
Keep in mind the Minetest version of Irrlicht is far behind the modern version of Irrlicht.
Thank you