spacekit icon indicating copy to clipboard operation
spacekit copied to clipboard

Ring shader not working on SphereObjects with Ephem

Open mattstvan opened this issue 4 years ago • 0 comments

First of all, this project looks fantastic and has a ton of potential. Kudos.

It appears that when rings are added to a SphereObject with ephem (i.e. being propagated around the scene), the rings become unlit. It seems to be related to the ring shader, but I'm no Three.js expert.

Example: image

My project uses webpack, but I can replicate the issue on a static page using the code below.

const viz = new Spacekit.Simulation(document.getElementById('main-container'), {
  jdPerSecond: 0.05,
  unitsPerAu: 100.0,
});

viz.createObject('sun', Spacekit.SpaceObjectPresets.SUN);
viz.createAmbientLight();
viz.createLight([0, 0, 0]);

const saturn = viz.createSphere('saturn', {
  textureUrl: './saturn.jpg',
  ephem: Spacekit.EphemPresets.SATURN,
  radius: 58232.503 / 149598000,
});
saturn.addRings(74270.580913, 140478.924731, './saturn_ring.png');
viz.getViewer().followObject(saturn, [-0.75, -0.75, 0.5]);

mattstvan avatar Oct 18 '21 01:10 mattstvan