Im looking into getting my scene looking better and it seems as though using a HDR maybe a good approach. I dont necessarily want the background to be an image, but just use it for the lights
Unfortuantley, as with alot of the three examples, as a novice I struggle to understand what/why certain things are done and what options are available to me as they are rarely commented nicely. Can anyone point me in the direction of how to start? I can see a new THREE.CubeTextureLoader but not sure what to do with it?
So this is possibly really stupid of me, but I would like to confirm what I think I can achieve…
I dont necessarily want an image background, more likely a solid colour/gradient
I want to be able to have nice “studio” lighting schemes.
so for #1 I can set my background to any colour easily enough, at the moment I my three scene is transparent so its just css on the body.
for #2 this is where i wanted to use a hdr. Im more familiar with traditional cad rendering packages where you can set a hdr for the lights, but not actually so it is the background.
to achieve this I was going to set my material to be MeshStandardMaterial and set its envMap to my hdr image (split up to be a cube as previously mentioned). How do i then get the hdr to light the scene but keep a transparent background? Am i correct in thinking once thats done I wont require any other lights?
Could you show me how to do with without the GUI attached? I keep trying to attach it to the standard materials envmap but I get errors because the GUI controls it. I don’t understand how to make the same example without the GUI and which code is relevant to only getting the basics to work.
For the material i just followed what i found in the documentation. You make a new cubeTextureLoader and then assign that as the environmental map of a material, which you can then use on your geometry…
var loader = new THREE.CubeTextureLoader();
loader.setPath( 'textures/cube/pisa/' );
var textureCube = loader.load( [
'px.png', 'nx.png',
'py.png', 'ny.png',
'pz.png', 'nz.png'
] );
var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );`
I however am using a MeshStandardMaterial rather than mesh basic.
It looks good and as I expected.
Now I am stuck on the best approach to lighting the scene, as with none, no matter what cubemap i use its dark
Is it common practice to add additional lights?
In which case how do i ensure they are in the correct place to match the env map?
Should I always have at least an ambient light?
If i want shadows, how can i ensure they look correct for the env map of the material?
I feel i am missing something very fundamental here, so any guidance would be appriciated
The only thing I don’t like about sketchfab is that it seems to only run in specified windows or some shit. You can’t just plop a model in an html5 webpage.
You can’t rotate because you need the orbiter script and you need to call on it in the javascript.
It’s pretty normal to need direct lighting of some sort. That’s pretty normal for game engines. Which 3JS is basically a game engine. In UE4, Unity, Etc. they don’t employ HDRI Lighting either. They do allow for reflection cubemaps, which what this is. In UE4 and other game engines, they bake the lightmaps in a 3D program. So the irradiance is baked in those games. It’s not dynamic.
There are things like irradiance volumes in game engines but they aren’t amazing. Somebody figured out a solution in UE4 but then it got shitcanned for some reason.
So, short answer, yes, you still need a light. Somewhere in sketch fab, there’s gotta be an initial light that they have turned on. Just about every program does. Maya and Max even make it hard to turn off. They have it on by default and the first light put in the scene disables it.
Blockquote im not sure I understand what you mean by that? In sketchfab you can rotate the enviroment, which seems to roate the env map of the objects
My mistake! I thought you meant rotate the camera. That I do not know. Maybe ask one of the more knowledgeable people on here ha. My guess is to set it up correctly in your 3D program first if there is no other way.