Anyway, irrlicht natively I think it only supports 2 uvmaps per 3d model, is there a way to increase this value? b3d supports exporting up to 8 uvmaps
Thanks mr cuteAlien
Code: Select all
void EffectHandler::bindGLTextureToUnit(unsigned int unit, irr::video::ITexture* texture, bool setMipLinear)
{
if ( !texture )
return;
// super ugly - I directly include "COpenGLDriver.h" in an app to allow for that
irr::video::COpenGLDriver* gldriver = static_cast<irr::video::COpenGLDriver*>(driver);
if ( !gldriver )
return;
irr::video::SExposedTextureData exposedTexData = texture->getExposedTextureData();
GLuint texName = exposedTexData.OpenGL.TextureName;
//GLboolean isTex = glIsTexture(texName);
GLenum target = exposedTexData.OpenGL.TextureType;
gldriver->extGlBindTextures(unit, 1, &texName, &target);
if ( setMipLinear )
{
gldriver->getCacheHandler()->setActiveTexture(GL_TEXTURE0 + unit);
glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if (gldriver->queryOpenGLFeature(irr::video::COpenGLExtensionHandler::IRR_EXT_texture_filter_anisotropic) || gldriver->Version >= 406)
{
glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, 16);
}
gldriver->testGLError(__LINE__);
}
}


The bottom part is the uvmap, the uvmap adapts to the camera projection, blender internal uses z-buffer, cycles uses ray tracing for the projection, I understand so it is something more similar to w-buffer.CuteAlien wrote: Sun Apr 19, 2026 4:18 pm Yeah, that was only GL, I haven't used D3D for a few years. Because Irrlicht only supports D3D9 which is very outdated and misses features which I can get working in GL.
And sorry, but I did not understand your explanation about angles and why this needs uv-maps to be changed (instead of just texture changes).
Note that if it's about moving reflections around on top of another textures you can also move textures without changing uv's by modifying the texture-matrix.



Yes, using a new texture instead of changing the uvmap solves the problem, although to obtain the same quality you need it to be of a higher resolution in some cases, in some it is the same.CuteAlien wrote: Sun Apr 19, 2026 7:44 pm But why use a new projection for each angle? You only need to render new textures? I'm probably still missing something
Note - you can always swap whole object as well. Show the one with the correct uv projection.
And yes - precalculated lightmaps are trouble if you rotate stuff. Thought you can rotate the texture in the opposite direction if you want keep the lightmaps lighting up the same place if you rotate an object. With texture-matrices.
Using reflection2layer perhaps a similar result can be achieved, in my mind I imagine a skybox or any cube that contains a panoramic image in it. Basically I think I'm trying to do what you tell me, but in a different way lmao. I can simulate reflections when rendering in low resolution using RTT, for example I could go to Blender and use the camera in panoramic style to obtain the panoramic image, I think there are ways to convert said image into a usable skybox by irrlicht. Then I simulate what a mirror does, the light bounces from an opposite point until it reaches my eye, so that the color I see of the object is not that of the object itself, but the color that it failed to absorb the light, a mirror could make a part of your face shine if the light goes in that direction, changing the color of your face to a lighter color... ah I'm getting complicated, I simply render the cube simulating having a camera in the position of the object, the camera always looking at me, so that When the camera rotates towards my direction, the value of the cube where I have the skybox will be updated... ah, I keep getting complicated, most of the realism is in reflecting the light of a real environment on the object, reflection2layer achieves it coherently if the angle of reflection matches the light that bounces off the surface towards your direction, basically you render the cube where you have the skybox all the time, but not the entire scene, then you pass said texture to the 3D model, the skybox could be the interior of A house for example, houses having structures with little light reflection or a roughness that is too high, almost does not bounce light, but it does, so as the reflection2layer multiplies on top of the first texture, you simply increase the brightness of the skybox texture a lot, the more brightness is equivalent to less reflection, then you will get a realistic surface when you move... ah but I am getting too complicated.CuteAlien wrote: Sun Apr 19, 2026 9:44 pm I'm pretty sure we're still talking past each other. If you want only 1 texture but move it over the model use a texture matrix (texture matrices have translate and rotate functions to make this easy). I thought maybe you need several because with more complicated models moving the texture makes no sense. But for those you also won't be able to use a single lightmap anyway and still have different rotations of same model. So in that case you'll end up with different textures anyway.
You really only need uv changes if the uv's change in a non-linear way (not simply move, rotate, scale, but completly different uv layout).
I see that my eye does something that I also want to replicate, I will exemplify it according to how I think it could work in irrlicht but I still can't achieve it:CuteAlien wrote: Sun Apr 19, 2026 10:28 pm Trust me I know that realistic environment light is tricky. I spend last 4 months full-time on that and I'm still failing. At least once you go beyond a simple metal helmet and an environment map (yeah, I know that demo as well ^_^)
Thank you so much, mr cuteAlien. I hope you are greatly blessed in this life for your kindness in answering these questionsCuteAlien wrote: Tue Apr 21, 2026 10:06 am You can have 8 textures per material. You have 1 material per meshbuffer.
You can have as as many meshbuffer in a mesh (model) as you want. Basically a main point of a meshbuffer is to split the parts in a model which have different materials.
UV's are in the mesh (S3DVertex) - not in the material. So you can't have UV's per material.