water not working correctly with shaders on...

2 replies [Last post]
Offline
Joined: 10/01/2012

 not sure what is happening...

 

here is what it looks like:

 

when the window is selected it is even more pink and jittery.

 

what should i do to fix it?

 

 

(here's my Game class code:

public class Game  {      public Game() {              }                public void play() {                  // EnvAdvanced must be used for water to work          Env env = new EnvAdvanced();                               // Need to use a skybox for our environment, so the water          // has something to reflect.          env.setRoom(new EnvSkyRoom("textures/skybox/default"));                               // Create the water object          EnvWater water = new EnvWater();                      // Make the water plain a 10x10 square          water.setScale(10);                      // Add the wataer object into our environment.          env.addObject(water);                              // Add an object another our environment          EnvObject o = new EnvObject();          o.setScale(1);          o.setZ(1);          o.setX(5);          o.setY(5);             env.addObject(o);                      // Look at the water plain from the side          env.setCameraXYZ(-10, 5, 5);          env.setCameraYaw(-55);                        // Exit when the escape key is pressed          while (env.getKey() != 1) {              // Rotate the water              env.advanceOneFrame();          }          env.exit();      }                   public static void main(String [] args) {          (new Game()).play();      }  }   

 

Offline
Joined: 10/01/2012
code not displaying...

import env3d.*;

import env3d.advanced.*;
 
public class Game
{
    public Game() {        
    }
        
    public void play() {        
        // EnvAdvanced must be used for water to work
        Env env = new EnvAdvanced();
                   
        // Need to use a skybox for our environment, so the water
        // has something to reflect.
        env.setRoom(new EnvSkyRoom("textures/skybox/default"));
                   
        // Create the water object
        EnvWater water = new EnvWater();
          
        // Make the water plain a 10x10 square
        water.setScale(10);
          
        // Add the wataer object into our environment.
        env.addObject(water);        
          
        // Add an object another our environment
        EnvObject o = new EnvObject();
        o.setScale(1);
        o.setZ(1);
        o.setX(5);
        o.setY(5);
 
        env.addObject(o);
          
        // Look at the water plain from the side
        env.setCameraXYZ(-10, 5, 5);
        env.setCameraYaw(-55);
            
        // Exit when the escape key is pressed
        while (env.getKey() != 1) {
            // Rotate the water
            env.advanceOneFrame();
        }
        env.exit();
    }     
      
    public static void main(String [] args) {
        (new Game()).play();
    }
}
 
class Util {
    /**
     * A function to calculate the distance between 2 objects in 3 dimension.
     */
    public static double distance(double x1, double x2, double y1, double y2, double z1, double z2) {
        double xdiff, ydiff, zdiff;
        xdiff = x2 - x1;
        ydiff = y2 - y1;
        zdiff = z2 - z1;
        return Math.sqrt(xdiff*xdiff + ydiff*ydiff + zdiff*zdiff);
    }
}
Offline
Joined: 01/08/2011
Water Object

Looks like either your video card is not set up properly or it doesn't have the appropriate drivers installed. It could also be that your video card is simply not able to handle the rendering of the water object. My computer at home renders the water object fine but the computers in the labs at capU cannot.