Now that rendering is progressing nicely, it'd be great to have something other than the renderer's clear color to look at in the distance.
Note that this issue is specific to the skyboxes used for maps. WMO skyboxes are defined a bit differently, and can be handled in a follow up issue.
Progress
[ ] Determine where map-level skyboxes are defined
Probably in the DBC files?
[ ] Set up mechanism to change skybox based on whatever is defined for the map
[ ] Hook up skybox rendering to WorldHandler / GameScreen
Notes
To render skyboxes correctly in relation to the camera and terrain/doodads/WMOs/etc, we'll want to disable autoClear on the renderer, and switch to a two-pass rendering approach. We'll also want to make sure to copy the camera position to the skybox each tick of animate.
The renderer changes in the animation loop will look something like this:
Clear the renderer to an appropriate color-- this color will probably will come from light params once we have a light manager
Render a THREE.Scene that only contains the skybox M2
Call clearDepth() on the renderer (ensures the skybox remains underneath everything)
Render a THREE.Scene that contains everything else (terrain, doodads, WMOs, etc)
Now that rendering is progressing nicely, it'd be great to have something other than the renderer's clear color to look at in the distance.
Note that this issue is specific to the skyboxes used for maps. WMO skyboxes are defined a bit differently, and can be handled in a follow up issue.
Progress
WorldHandler
/GameScreen
Notes
To render skyboxes correctly in relation to the camera and terrain/doodads/WMOs/etc, we'll want to disable
autoClear
on the renderer, and switch to a two-pass rendering approach. We'll also want to make sure to copy the camera position to the skybox each tick ofanimate
.The renderer changes in the animation loop will look something like this:
THREE.Scene
that only contains the skybox M2clearDepth()
on the renderer (ensures the skybox remains underneath everything)THREE.Scene
that contains everything else (terrain, doodads, WMOs, etc)