Java Code Examples for com.jme3.math.ColorRGBA

The following examples show how to use com.jme3.math.ColorRGBA. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
protected void initFilter(AssetManager manager, RenderManager rm, ViewPort vp, int w, int h) {
    this.renderManager = rm;
    this.viewPort = vp;
    material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md");
    material.setColor("Color", ColorRGBA.White);
    Texture2D tex = processor.getFilterTexture();
    material.setTexture("Texture", tex);
    if (tex.getImage().getMultiSamples() > 1) {
        material.setInt("NumSamples", tex.getImage().getMultiSamples());
    } else {
        material.clearParam("NumSamples");
    }
    renderManager.setHandleTranslucentBucket(false);
    if (enabledSoftParticles && depthTexture != null) {
        initSoftParticles(vp, true);
    }
}
 
Example 2
@Override
public void simpleInitApp() {
    Sphere sphMesh = new Sphere(32, 32, 1);
    sphMesh.setTextureMode(Sphere.TextureMode.Projected);
    sphMesh.updateGeometry(32, 32, 1, false, false);
    TangentBinormalGenerator.generate(sphMesh);

    Geometry sphere = new Geometry("Rock Ball", sphMesh);
    Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
    mat.setColor("Ambient", ColorRGBA.DarkGray);
    mat.setColor("Diffuse", ColorRGBA.White);
    mat.setBoolean("UseMaterialColors", true);
    sphere.setMaterial(mat);
    rootNode.attachChild(sphere);

    PointLight pl = new PointLight();
    pl.setColor(ColorRGBA.White);
    pl.setPosition(new Vector3f(4f, 0f, 0f));
    rootNode.addLight(pl);

    AmbientLight al = new AmbientLight();
    al.setColor(ColorRGBA.White);
    rootNode.addLight(al);
}
 
Example 3
private void createFlame(){
    flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
    flame.setSelectRandomImage(true);
    flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F)));
    flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
    flame.setStartSize(1.3f);
    flame.setEndSize(2f);
    flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
    flame.setParticlesPerSec(0);
    flame.setGravity(0, -5, 0);
    flame.setLowLife(.4f);
    flame.setHighLife(.5f);
    flame.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 7, 0));
    flame.getParticleInfluencer().setVelocityVariation(1f);
    flame.setImagesX(2);
    flame.setImagesY(2);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
    mat.setBoolean("PointSprite", POINT_SPRITE);
    flame.setMaterial(mat);
    explosionEffect.attachChild(flame);
}
 
Example 4
@Override
@FxThread
protected boolean validate(@NotNull final VarTable vars) {

    final Color color = UiUtils.from(vars.get(PROP_COLOR, ColorRGBA.class));

    final int width = vars.getInteger(PROP_WIDTH);
    final int height = vars.getInteger(PROP_HEIGHT);

    final WritableImage writableImage = new WritableImage(width, height);
    final PixelWriter pixelWriter = writableImage.getPixelWriter();

    for (int i = 0; i < width; i++) {
        for (int j = 0; j < height; j++) {
            pixelWriter.setColor(i, j, color);
        }
    }

    getImageView().setImage(writableImage);
    return true;
}
 
Example 5
@Override
public void simpleInitApp() {
    viewPort.setBackgroundColor(ColorRGBA.Gray);

    cam.setLocation(new Vector3f(-5.6310086f, 5.0892987f, -13.000479f));
    cam.setRotation(new Quaternion(0.1779095f, 0.20036356f, -0.03702727f, 0.96272093f));
    cam.update();

    cam.setFrustumFar(300);
    flyCam.setMoveSpeed(30);

    rootNode.setCullHint(CullHint.Never);

    setupLighting();
    setupModel();
    setupFilters();
}
 
Example 6
/**
 * Initializes game 
 */
@Override
public void simpleInitApp() {
    Logger.getLogger("com.jme3").setLevel(Level.WARNING);

    flyCam.setEnabled(false);
    setDisplayStatView(false);

    Keys();

    defaultFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    pressStart = new BitmapText(defaultFont, false);
    fpsScoreText = new BitmapText(defaultFont, false);

    loadText(fpsScoreText, "Current Score: 0", defaultFont, 0, 2, 0);
    loadText(pressStart, "PRESS ENTER", defaultFont, 0, 5, 0);
    
    player = createPlayer();
    rootNode.attachChild(player);
    cubeField = new ArrayList<Geometry>();
    obstacleColors = new ArrayList<ColorRGBA>();

    gameReset();
}
 
Example 7
public void renderImage(RenderImage image, int x, int y, int width, int height,
                       Color color, float imageScale){

        RenderImageJme jmeImage = (RenderImageJme) image;

        niftyMat.getAdditionalRenderState().setBlendMode(convertBlend());
        niftyMat.setColor("Color", ColorRGBA.White);
        niftyMat.setTexture("Texture", jmeImage.getTexture());
        niftyMat.setBoolean("UseTex", true);
        setColor(color);

        quad.clearBuffer(Type.TexCoord);
        quad.setBuffer(quadDefaultTC);

        float x0 = x + 0.5f * width  * (1f - imageScale);
        float y0 = y + 0.5f * height * (1f - imageScale);

        tempMat.loadIdentity();
        tempMat.setTranslation(x0, getHeight() - y0, 0);
        tempMat.setScale(width * imageScale, height * imageScale, 0);

        rm.setWorldMatrix(tempMat);
        niftyMat.render(quadGeom, rm);
//        
//        System.out.println("renderImage");
    }
 
Example 8
private Image createTestImage() {
    Image testImage = new Image(Format.BGR8, 4, 3, BufferUtils.createByteBuffer(4 * 4 * 3), null, ColorSpace.Linear);
    
    ImageRaster io = ImageRaster.create(testImage);
    io.setPixel(0, 0, ColorRGBA.Black);
    io.setPixel(1, 0, ColorRGBA.Gray);
    io.setPixel(2, 0, ColorRGBA.White);
    io.setPixel(3, 0, ColorRGBA.White.mult(4)); // HDR color

    io.setPixel(0, 1, ColorRGBA.Red);
    io.setPixel(1, 1, ColorRGBA.Green);
    io.setPixel(2, 1, ColorRGBA.Blue);
    io.setPixel(3, 1, new ColorRGBA(0, 0, 0, 0));

    io.setPixel(0, 2, ColorRGBA.Yellow);
    io.setPixel(1, 2, ColorRGBA.Magenta);
    io.setPixel(2, 2, ColorRGBA.Cyan);
    io.setPixel(3, 2, new ColorRGBA(1, 1, 1, 0));
    
    return testImage;
}
 
Example 9
public void showSkeleton(boolean flag) {
    if (flag) {
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Green);
        mat.getAdditionalRenderState().setDepthTest(false);
        SkeletonWire sw = new SkeletonWire(skeleton);
        Geometry skeletonWireGeom = new Geometry("skeletonWire", sw);
        model.attachChild(skeletonWireGeom);
        skeletonWireGeom.setMaterial(mat);
        skeletonWireGeom.setQueueBucket(Bucket.Transparent);
    } else {
        if (skeletonLineNode != null) {
            skeletonLineNode.removeFromParent();
            skeletonLineNode = null;
        }
    }
}
 
Example 10
public void renderQuad(int x, int y, int width, int height, Color color){
        niftyMat.getAdditionalRenderState().setBlendMode(convertBlend());
        niftyMat.setColor("Color", ColorRGBA.White);
        niftyMat.clearParam("Texture");
        niftyMat.setBoolean("UseTex", false);
        setColor(color);

        tempMat.loadIdentity();
        tempMat.setTranslation(x, getHeight() - y, 0);
        tempMat.setScale(width, height, 0);

        rm.setWorldMatrix(tempMat);
        niftyMat.render(quadGeom, rm);
        
//        System.out.println("renderQuad (Solid)");
    }
 
Example 11
private static Texture2D createCheckerBoardTexture() {
    Image image = new Image(Format.RGBA8, 1024, 1024, BufferUtils.createByteBuffer(1024 * 1024 * 4), ColorSpace.sRGB);
    
    ImageRaster raster = ImageRaster.create(image);
    for (int y = 0; y < 1024; y++) {
        for (int x = 0; x < 1024; x++) {
            if (y < 512) {
                if (x < 512) {
                    raster.setPixel(x, y, ColorRGBA.Black);
                } else {
                    raster.setPixel(x, y, ColorRGBA.White);
                }
            } else {
                if (x < 512) {
                    raster.setPixel(x, y, ColorRGBA.White);
                } else {
                    raster.setPixel(x, y, ColorRGBA.Black);
                }
            }
        }
    }

    return new Texture2D(image);
}
 
Example 12
private void createDebris(){
        debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR);
        debris.setSelectRandomImage(true);
        debris.setRandomAngle(true);
        debris.setRotateSpeed(FastMath.TWO_PI * 4);
        debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, (float) (1.0f / COUNT_FACTOR_F)));
        debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f));
        debris.setStartSize(.2f);
        debris.setEndSize(.2f);

//        debris.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
        debris.setParticlesPerSec(0);
        debris.setGravity(0, 12f, 0);
        debris.setLowLife(1.4f);
        debris.setHighLife(1.5f);
        debris.setInitialVelocity(new Vector3f(0, 15, 0));
        debris.setVelocityVariation(.60f);
        debris.setImagesX(3);
        debris.setImagesY(3);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
        mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
        debris.setMaterial(mat);
        explosionEffect.attachChild(debris);
    }
 
Example 13
Source Project: Lemur   Source File: PopupState.java    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
protected Geometry createBlocker( float z, ColorRGBA backgroundColor ) {
    Camera cam = getApplication().getCamera();
 
    // Get the inverse scale of whatever the current guiNode is so that
    // we can find a proper screen size
    float width = cam.getWidth() / guiNode.getLocalScale().x;
    float height = cam.getHeight() / guiNode.getLocalScale().y;
    
    Quad quad = new Quad(width, height);
    Geometry result = new Geometry("blocker", quad);
    GuiMaterial guiMat = createBlockerMaterial(backgroundColor);
    result.setMaterial(guiMat.getMaterial());
    //result.setQueueBucket(Bucket.Transparent); // no, it goes in the gui bucket.
    result.setLocalTranslation(0, 0, z);
    return result;
}
 
Example 14
private void createDebris(){
        debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR);
        debris.setSelectRandomImage(true);
        debris.setRandomAngle(true);
        debris.setRotateSpeed(FastMath.TWO_PI * 4);
        debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, 1.0f / COUNT_FACTOR_F));
        debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f));
        debris.setStartSize(.2f);
        debris.setEndSize(.2f);

//        debris.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
        debris.setParticlesPerSec(0);
        debris.setGravity(0, 12f, 0);
        debris.setLowLife(1.4f);
        debris.setHighLife(1.5f);
        debris.getParticleInfluencer()
                .setInitialVelocity(new Vector3f(0, 15, 0));
        debris.getParticleInfluencer().setVelocityVariation(.60f);
        debris.setImagesX(3);
        debris.setImagesY(3);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
        mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
        debris.setMaterial(mat);
        explosionEffect.attachChild(debris);
    }
 
Example 15
/** A floor to show that the "shot" can go through several objects. */
protected Geometry makeFloor() {
    Box box = new Box(15, .2f, 15);
    Geometry floor = new Geometry("the Floor", box);
    floor.setLocalTranslation(0, -4, -5);
    Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat1.setColor("Color", ColorRGBA.Gray);
    floor.setMaterial(mat1);
    return floor;
}
 
Example 16
@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule oc = ex.getCapsule(this);
    oc.write(fogColor, "fogColor", ColorRGBA.White.clone());
    oc.write(fogDensity, "fogDensity", 0.7f);
    oc.write(fogDistance, "fogDistance", 1000);
}
 
Example 17
private void setUpLight() {
  // We add light so we see the scene
  AmbientLight al = new AmbientLight();
  al.setColor(ColorRGBA.White.mult(1.3f));
  rootNode.addLight(al);

  DirectionalLight dl = new DirectionalLight();
  dl.setColor(ColorRGBA.White);
  dl.setDirection(new Vector3f(2.8f, -2.8f, -2.8f).normalizeLocal());
  rootNode.addLight(dl);
}
 
Example 18
public void notifyListeners(ColorRGBA before, ColorRGBA after) {
    for (Iterator<PropertyChangeListener> it = listeners.iterator(); it.hasNext();) {
        PropertyChangeListener propertyChangeListener = it.next();
        //TODO: check what the "programmatic name" is supposed to be here.. for now its ColorRGBA
        propertyChangeListener.propertyChange(new PropertyChangeEvent(this, null, before, after));
    }
}
 
Example 19
@Override
public void simpleInitApp() {
    this.flyCam.setMoveSpeed(50);
    Node mainScene=new Node();
    cam.setLocation(new Vector3f(-34.74095f, 95.21318f, -287.4945f));
    cam.setRotation(new Quaternion(0.023536969f, 0.9361278f, -0.016098259f, -0.35050195f));

    // load sky
    mainScene.attachChild(SkyFactory.createSky(assetManager, 
            "Textures/Sky/Bright/BrightSky.dds", 
            SkyFactory.EnvMapType.CubeMap));
    createTerrain(mainScene);



    DirectionalLight sun = new DirectionalLight();
    Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
    sun.setDirection(lightDir);
    sun.setColor(ColorRGBA.White.clone().multLocal(2));
    mainScene.addLight(sun);

    rootNode.attachChild(mainScene);

    fpp=new FilterPostProcessor(assetManager);
    //fpp.setNumSamples(4);
    int numSamples = getContext().getSettings().getSamples();
    if( numSamples > 0 ) {
        fpp.setNumSamples(numSamples); 
    }
    fog=new FogFilter();
    fog.setFogColor(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f));
    fog.setFogDistance(155);
    fog.setFogDensity(1.0f);
    fpp.addFilter(fog);
    viewPort.addProcessor(fpp);
    initInputs();
}
 
Example 20
private Geometry CreateLinearPath() {

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.getAdditionalRenderState().setWireframe(true);
        mat.setColor("Color", ColorRGBA.Blue);
        Geometry lineGeometry = new Geometry("line", new Curve(spline, 0));
        lineGeometry.setMaterial(mat);
        return lineGeometry;
    }
 
Example 21
Source Project: MikuMikuStudio   Source File: TestAmbient.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void simpleInitApp() {
  float[] eax = new float[]{15, 38.0f, 0.300f, -1000, -3300, 0,
    1.49f, 0.54f, 1.00f, -2560, 0.162f, 0.00f, 0.00f,
    0.00f, -229, 0.088f, 0.00f, 0.00f, 0.00f, 0.125f, 1.000f,
    0.250f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.00f, 0x3f};
  Environment env = new Environment(eax);
  audioRenderer.setEnvironment(env);

  waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false);
  waves.setPositional(true);
  waves.setLocalTranslation(new Vector3f(0, 0,0));
  waves.setMaxDistance(100);
  waves.setRefDistance(5);

  nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", true);
  nature.setVolume(3);
  
  waves.playInstance();
  nature.play();
  
  // just a blue box to mark the spot
  Box box1 = new Box(Vector3f.ZERO, .5f, .5f, .5f);
  Geometry player = new Geometry("Player", box1);
  Material mat1 = new Material(assetManager,
          "Common/MatDefs/Misc/Unshaded.j3md");
  mat1.setColor("Color", ColorRGBA.Blue);
  player.setMaterial(mat1);
  rootNode.attachChild(player);
}
 
Example 22
Source Project: jmonkeybuilder   Source File: AbstractPaintingControl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create a colored material.
 *
 * @param color the color.
 * @return the colored material.
 */
@JmeThread
protected @NotNull Material createColoredMaterial(@NotNull final ColorRGBA color) {
    final Material material = new Material(EditorUtil.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
    material.setColor("Color", color);
    return material;
}
 
Example 23
public ColorRGBA randomColor() {
    ColorRGBA color = ColorRGBA.Black;
    int randomn = rand.nextInt(4);
    if (randomn == 0) {
        color = ColorRGBA.Orange;
    } else if (randomn == 1) {
        color = ColorRGBA.Blue;
    } else if (randomn == 2) {
        color = ColorRGBA.Brown;
    } else if (randomn == 3) {
        color = ColorRGBA.Magenta;
    }
    return color;
}
 
Example 24
protected static ColorRGBA getAmbientColor(LightList lightList, boolean removeLights, ColorRGBA ambientLightColor) {
    ambientLightColor.set(0, 0, 0, 1);
    for (int j = 0; j < lightList.size(); j++) {
        Light l = lightList.get(j);
        if (l instanceof AmbientLight) {
            ambientLightColor.addLocal(l.getColor());
            if (removeLights) {
                lightList.remove(l);
            }
        }
    }
    ambientLightColor.a = 1.0f;
    return ambientLightColor;
}
 
Example 25
/** A cube object for target practice */
protected Geometry makeCube(String name, float x, float y, float z) {
    Box box = new Box(new Vector3f(x, y, z), 1, 1, 1);
    Geometry cube = new Geometry(name, box);
    Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat1.setColor("Color", ColorRGBA.randomColor());
    cube.setMaterial(mat1);
    return cube;
}
 
Example 26
@Override
public void simpleInitApp() {
    // Create two boxes
    Mesh mesh1 = new Box(0.5f, 0.5f, 0.5f);
    geom1 = new Geometry("Box", mesh1);
    geom1.move(2, 2, -.5f);
    Material m1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    m1.setColor("Color", ColorRGBA.Blue);
    geom1.setMaterial(m1);
    rootNode.attachChild(geom1);

    // load a character from jme3test-test-data
    golem = assetManager.loadModel("Models/Oto/Oto.mesh.xml");
    golem.scale(0.5f);
    golem.setLocalTranslation(-1.0f, -1.5f, -0.6f);

    // We must add a light to make the model visible
    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
    golem.addLight(sun);
    rootNode.attachChild(golem);

    // Create input
    inputManager.addMapping("MoveRight", new KeyTrigger(KeyInput.KEY_L));
    inputManager.addMapping("MoveLeft", new KeyTrigger(KeyInput.KEY_J));
    inputManager.addMapping("MoveUp", new KeyTrigger(KeyInput.KEY_I));
    inputManager.addMapping("MoveDown", new KeyTrigger(KeyInput.KEY_K));

    inputManager.addListener(analogListener, new String[]{
                "MoveRight", "MoveLeft", "MoveUp", "MoveDown"
            });
}
 
Example 27
Source Project: jmonkeybuilder   Source File: UiUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Convert a color from {@link ColorRGBA} to {@link Color}.
 *
 * @param color the color
 * @return the FX color
 */
@FxThread
public static @Nullable Color from(@Nullable final ColorRGBA color) {
    if (color == null) return null;

    final float red = min(color.getRed(), 1F);
    final float green = min(color.getGreen(), 1F);
    final float blue = min(color.getBlue(), 1F);
    final float alpha = min(color.getAlpha(), 1F);

    return new Color(red, green, blue, alpha);
}
 
Example 28
Source Project: Lemur   Source File: ColorChooser.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected ColorChooser( boolean applyStyles, VersionedObject<ColorRGBA> model,
                        ElementId elementId, String style ) {
    super(false, elementId.child(CONTAINER_ID), style);

    this.swatchTexture = defaultTexture;

    SpringGridLayout layout = new SpringGridLayout();
    getControl(GuiControl.class).setLayout(layout);

    colorPanel = new Container(elementId.child(COLORS_ID), style);
    colorPanel.setLayout(new SpringGridLayout());
    colors = new Panel();
    colorPanel.addChild(colors);
    this.swatchComponent = new QuadBackgroundComponent(swatchTexture);
    CursorEventControl.addListenersToSpatial(colors, new SwatchListener());
    colors.setBackground(swatchComponent);
    colors.setPreferredSize(new Vector3f(256, 64, 0));
    layout.addChild(colorPanel, 2);

    brightness = new Slider(Axis.Y, elementId.child(BRIGHTNESS_ID), style);
    layout.addChild(brightness, 1);
    brightnessRef = brightness.getModel().createReference();

    value = new Panel(elementId.child(VALUE_ID), style);
    value.setPreferredSize(new Vector3f(64, 64, 0));
    value.setBackground(valueColor);
    layout.addChild(value, 0);

    if( applyStyles ) {
        Styles styles = GuiGlobals.getInstance().getStyles();
        styles.applyStyles(this, getElementId(), style);
    }

    setModel(model);
}
 
Example 29
@Override
public void simpleInitApp() {
    Box b = new Box(1, 1, 1); // create cube shape
    Geometry geom = new Geometry("Box", b);  // create cube geometry from the shape
    Material mat = new Material(assetManager,
            "Common/MatDefs/Misc/Unshaded.j3md");  // create a simple material
    mat.setColor("Color", ColorRGBA.Blue);   // set color of material to blue
    geom.setMaterial(mat);                   // set the cube's material
    rootNode.attachChild(geom);// make the cube appear in the scene
}
 
Example 30
Source Project: MikuMikuStudio   Source File: FogFilter.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Create a fog filter 
 * @param fogColor the color of the fog (default is white)
 * @param fogDensity the density of the fog (default is 0.7)
 * @param fogDistance the distance of the fog (default is 1000)
 */
public FogFilter(ColorRGBA fogColor, float fogDensity, float fogDistance) {
    this();
    this.fogColor = fogColor;
    this.fogDensity = fogDensity;
    this.fogDistance = fogDistance;
}