Hi all, im trying to set up my lightmap in three js. I can get it to display, but it appears to not be wrapping correctly. I’ve included a photo of the output.
Hi, this is great advice. I sent the blender advice to my friend to see if it would help (hes the one creating the model), and in the meantime I set up a three js example in codepen.
I logged out the lightmap, and I do see it, I also flippedY (i even tried flipping X and alternating Y). But nothing I do seems to work. Do you think you could take a quick look at my provided example and find what i’m doing wrong? This problem has plagued me for a couple days, would love to find a solution.
I have the following observation: the Three.js release is rather old, so some of the texture stuff might not be available (e.g. channels). Also, the uv and uv2 coordinates are different.
Here is the just light map based on uv coordinates (not uv2):
import * as THREE from ‘three’;
import { OrbitControls } from ‘three/addons/controls/OrbitControls.js’;
import { GLTFLoader } from ‘three/addons/loaders/GLTFLoader.js’;
Thanks! that looks to be it. Thank you so much. How did you know the channel to use? I guess you just experimented between 0 and 1 and then toggled flipY? Strange, I thought I had 100% tried that combination.
I didn’t. It was just a random change until it worked. BTW once it worked, it worked for a combination of parameters that I’m sure I had already tested before … and had failed. So, there is still some mystery.
A more systematic approach would be for someone with sufficiently good skills in Blender and Three.js to advice how to define/export things from Blender, so that they show up well in Three.js. There were many threads in this forum about models from Blender that cannot be immediately rendered well in Three.js, because of incompatibilities of geometries, materials, lights, maps, etc.