Commit b70d299e authored by iSergio's avatar iSergio
Browse files

Fix example

parent 60b693da
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -66,7 +66,11 @@ public class ImageBasedLighting extends AbstractExample {
        ViewerPanel csVPanel = new ViewerPanel();
        viewer = csVPanel.getViewer();

        environmentMapURL = GWT.getModuleBaseURL() + "SampleData/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx";
        if (!viewer.scene().specularEnvironmentMapsSupported()) {
            Window.alert("This browser does not support specular environment maps.");
        }

        environmentMapURL = "https://cesium.com/public/SandcastleSampleData/kiara_6_afternoon_2k_ibl.ktx2";
        String modelURL = GWT.getModuleBaseURL() + "SampleData/models/Pawns/Pawns.glb";

        // This environment map was processed using Google's Filament project. To
+27 −17
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import org.cleanlogic.cesiumjs4gwt.showcase.examples.slider.SliderListener;
import javax.inject.Inject;

/**
 * @author Serge Silaev aka iSergio <s.serge.b@gmail.com>
 * @author Serge Silaev aka iSergio
 */
public class ImageBasedLighting extends AbstractExample {
    public Viewer viewer;
@@ -38,9 +38,11 @@ public class ImageBasedLighting extends AbstractExample {

    private Slider luminanceAtZenithSlider;
    private TextBox luminanceAtZenithTBox;

    @Inject
    public ImageBasedLighting(ShowcaseExampleStore store) {
        super("Image-Based Lighting", "Use image-based lighting to light a model", new String[]{"Model", "lighting"}, store);
        super("Image-Based Lighting", "Use image-based lighting to light a model", new String[]{"Model", "lighting"},
                store);
    }

    @Override
@@ -48,13 +50,21 @@ public class ImageBasedLighting extends AbstractExample {
        ViewerPanel csVPanel = new ViewerPanel();
        viewer = csVPanel.getViewer();

        environmentMapURL = GWT.getModuleBaseURL() + "SampleData/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx";
        if (!viewer.scene().specularEnvironmentMapsSupported()) {
            Window.alert("This browser does not support specular environment maps.");
        }

        environmentMapURL = "https://cesium.com/public/SandcastleSampleData/kiara_6_afternoon_2k_ibl.ktx2";
        String modelURL = GWT.getModuleBaseURL() + "SampleData/models/Pawns/Pawns.glb";

        // This environment map was processed using Google's Filament project. To process your own:
        // 1 - Download the Filament release (https://github.com/google/filament/releases).
        // 2 - Run `cmgen --type=ktx --deploy=/path/to/output /path/to/image.hdr`. Other formats are also supported. Run `cmgen --help` for all options.
        // 3 - Take the generated coefficients and the KTX file and load them in CesiumJS as shown below.
        // This environment map was processed using Google's Filament project. To
        // process your own:
        // 1 - Download the Filament release
        // (https://github.com/google/filament/releases).
        // 2 - Run `cmgen --type=ktx --deploy=/path/to/output /path/to/image.hdr`. Other
        // formats are also supported. Run `cmgen --help` for all options.
        // 3 - Take the generated coefficients and the KTX file and load them in
        // CesiumJS as shown below.

        Cartesian3 L00 = new Cartesian3(0.170455150831422, 0.163151083190219, 0.196966760289763);
        Cartesian3 L1_1 = new Cartesian3(-0.066550267689383, -0.022088055746048, 0.078835009246127);