Models Crash Game on XP

I’ve been educating myself with JME, I have a decent bit of experience in Java, but not so much Blender or some of the other things involved in it. Anyways, to the point…

I was testing a model of a Zombie that I found. It isn’t UV mapped, but the materials are there. It loads just fine, and causes no errors on every other computer I’ve tried, including a Windows Vista and a Windows 7(Running off of a flash drive for both) but whenever I load it on my computer (A windows XP) my screen goes white and I get this error.

Oct 16, 2012 3:00:32 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: Shader link failure, shader:Shader[numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex, language=GLSL100], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment, language=GLSL100]]] info:Fragment info
Internal error: assembly compile error for fragment shader at offset 1769:
-- error message --
line 61, column 17: error: variable not valid as a source register
line 71, column 13: error: variable not valid as a source register
-- internal assembly text --
!!ARBfp1.0
OPTION NV_fragment_program2;
# cgc version 2.0.0018, build date Aug 1 2008 15:05:44
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile fp40
#program main
#semantic g_LightDirection
#semantic m_AlphaDiscardThreshold
#semantic m_Shininess
#var float2 texCoord : : : -1 : 0
#var float3 AmbientSum : $vin.TEX0 : TEX0 : -1 : 1
#var float4 DiffuseSum : $vin.TEX1 : TEX1 : -1 : 1
#var float3 SpecularSum : $vin.TEX2 : TEX2 : -1 : 1
#var float4 g_LightDirection : : c[0] : -1 : 1
#var float3 vViewDir : $vin.TEX3 : TEX3 : -1 : 1
#var float4 vLightDir : $vin.TEX4 : TEX4 : -1 : 1
#var float3 lightVec : $vin.TEX5 : TEX5 : -1 : 1
#var float3 vNormal : $vin.TEX6 : TEX6 : -1 : 1
#var float m_AlphaDiscardThreshold : : c[1] : -1 : 1
#var float m_Shininess : : c[2] : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var 4 $kill_0000 : $vout.$kill : $kill : -1 : 0
#const c[3] = 0 0.001 1 2
PARAM c[4] = { program.local[0..2],
{ 0, 0.001, 1, 2 } };
TEMP R0;
TEMP R1;
TEMP R2;
SHORT TEMP H0;
TEMP RC;
TEMP HC;
OUTPUT oCol = result.color;
DP3R R0.y, c[0], c[0];
RSQR R0.y, R0.y;
DP3R R0.x, fragment.texcoord[5], fragment.texcoord[5];
DP3R R2.x, fragment.texcoord[3], fragment.texcoord[3];
RSQR R2.x, R2.x;
MULR R1.xyz, R0.y, c[0];
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, fragment.texcoord[5];
DP3R R0.x, -R0, R1;
MOVR R1.zw, c[3].xyxz;
SNER H0.y, c[0].w, R1.z;
FRCR R0.y, c[0].w;
FLRR R0.z, c[0].w;
MADR R0.z, R0, c[3].y, -R0.y;
ADDR R0.y, R0.x, -R0;
MOVR R0.x, c[3].z;
RCPR R0.z, R0.z;
MOVXC RC.x, c[0].w;
MULR R0.x(NE), R0.y, R0.z;
SLER H0.z, R0.x, c[3].x;
SEQX H0.x, H0.z, c[3];
MULXC HC.x, H0.y, H0;
MULXC HC.y, H0, H0.z;
MOVR R0.w, R0.x;
MOVR_SAT R0.w(NE.x), R0.x;
MOVX H0.x, c[3];
MOVR oCol.xyz, oCol;
DP3R R0.y, fragment.texcoord[6], fragment.texcoord[6];
RSQR R0.y, R0.y;
DP3R R0.x, fragment.texcoord[4], fragment.texcoord[4];
MULR R1.xyz, R0.y, fragment.texcoord[6];
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, fragment.texcoord[4];
DP3R R2.w, R1, R0;
MULR R1.xyz, -R2.w, R1;
MADR R0.xyz, -R1, c[3].w, -R0;
MOVR R1.z, oCol.w;
MULR R2.xyz, R2.x, fragment.texcoord[3];
DP3R R0.x, R0, R2;
MOVX H0.x(EQ.y), c[3].z;
SLER H0.y, c[2].x, R1.w;
MAXR R0.x, R0, c[3];
MOVR R0.y, c[3].x;
MULXC HC.x, H0, H0.y;
POWR R0.y(EQ.x), R0.x, c[2].x;
MAXR R0.x, R2.w, c[3];
MULR R0.y, R0.x, R0;
MULR R0.xy, R0, fragment.texcoord[4].w;
MULR R1.xy, R0, R0.w;
MOVR R0.xyz, fragment.texcoord[0];
MOVXC RC.x, H0;
MADR R0.xyz, fragment.texcoord[1], R1.x, R0;
MOVR oCol.xyz(NE.y), fragment.texcoord[0];
MADR oCol.xyz(NE.x), fragment.texcoord[2], R1.y, R0;
MOVR R0.x, fragment.texcoord[1].w;
MOVR R1.z(NE.y), fragment.texcoord[1].w;
MOVR R0.x(EQ), R1.z;
SLTRC HC.x, fragment.texcoord[1].w, c[1];
KIL NE.x;
MOVR oCol.w, R0.x;
END
# 60 instructions, 3 R-regs, 1 H-regs



If it helps, this is the only class I'm currently running the test from.

[java]package com.scarykidz.infection;

import com.jme3.app.SimpleApplication;
import com.jme3.app.state.ScreenshotAppState;
import com.jme3.asset.plugins.ZipLocator;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.collision.shapes.HeightfieldCollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.font.BitmapText;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.AnalogListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.FogFilter;
import com.jme3.scene.Spatial;
import com.jme3.terrain.geomipmap.TerrainGrid;
import com.jme3.terrain.geomipmap.TerrainGridListener;
import com.jme3.terrain.geomipmap.TerrainGridLodControl;
import com.jme3.terrain.geomipmap.TerrainLodControl;
import com.jme3.terrain.geomipmap.TerrainQuad;
import com.jme3.terrain.geomipmap.grid.FractalTileLoader;
import com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator;
import com.jme3.terrain.noise.ShaderUtils;
import com.jme3.terrain.noise.basis.FilteredBasis;
import com.jme3.terrain.noise.filter.IterativeFilter;
import com.jme3.terrain.noise.filter.OptimizedErode;
import com.jme3.terrain.noise.filter.PerturbFilter;
import com.jme3.terrain.noise.filter.SmoothFilter;
import com.jme3.terrain.noise.fractal.FractalSum;
import com.jme3.terrain.noise.modulator.NoiseModulator;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.WrapMode;
import com.jme3.util.SkyFactory;
import com.jme3.animation.*;
import com.scarykidz.infection.util.Misc;
import com.jme3.audio.AudioNode;


public class Beginning extends SimpleApplication implements AnimEventListener {

private Material mat_terrain;
private TerrainGrid terrain;
private float grassScale = 64;
private float dirtScale = 16;
private float rockScale = 128;
private boolean usePhysics = true;
private RigidBodyControl building1_phy;
final BulletAppState bulletAppState = new BulletAppState();




public static void main(final String[] args) {
Beginning app = new Beginning();
app.start();
}
private CharacterControl player3;
private FractalSum base;
private PerturbFilter perturb;
private OptimizedErode therm;
private SmoothFilter smooth;
private IterativeFilter iterate;
private FilterPostProcessor fpp;
private boolean enabled = true;
private FogFilter fog;
private AudioNode audio_gun;

@Override
public void simpleInitApp() {
this.flyCam.setMoveSpeed(100f);
stateManager.attach(bulletAppState);

setDisplayStatView(false);
setDisplayFps(true);
ScreenshotAppState state = new ScreenshotAppState();
this.stateManager.attach(state);

// TERRAIN TEXTURE material
this.mat_terrain = new Material(this.assetManager, "Common/MatDefs/Terrain/HeightBasedTerrain.j3md");

// Parameters to material:
// regionXColorMap: X = 1..4 the texture that should be appliad to state X
// regionX: a Vector3f containing the following information:
// regionX.x: the start height of the region
// regionX.y: the end height of the region
// regionX.z: the texture scale for the region
// it might not be the most elegant way for storing these 3 values, but it packs the data nicely :)
// slopeColorMap: the texture to be used for cliffs, and steep mountain sites
// slopeTileFactor: the texture scale for slopes
// terrainSize: the total size of the terrain (used for scaling the texture)
// GRASS texture
Texture grass = this.assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
grass.setWrap(WrapMode.Repeat);
this.mat_terrain.setTexture("region1ColorMap", grass);
this.mat_terrain.setVector3("region1", new Vector3f(15, 200, this.grassScale));

// DIRT texture
Texture dirt = this.assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
dirt.setWrap(WrapMode.Repeat);
this.mat_terrain.setTexture("region2ColorMap", dirt);
this.mat_terrain.setVector3("region2", new Vector3f(0, 20, this.dirtScale));

// ROCK texture
Texture rock = this.assetManager.loadTexture("Textures/Terrain/Rock2/rock.jpg");
rock.setWrap(WrapMode.Repeat);
this.mat_terrain.setTexture("region3ColorMap", rock);
this.mat_terrain.setVector3("region3", new Vector3f(198, 260, this.rockScale));

this.mat_terrain.setTexture("region4ColorMap", rock);
this.mat_terrain.setVector3("region4", new Vector3f(198, 260, this.rockScale));

this.mat_terrain.setTexture("slopeColorMap", rock);
this.mat_terrain.setFloat("slopeTileFactor", 64);

this.mat_terrain.setFloat("terrainSize", 2049);

this.base = new FractalSum();
this.base.setRoughness(0.65f);
this.base.setFrequency(0.6f);
this.base.setAmplitude(0.8f);
this.base.setLacunarity(2.12f);
this.base.setOctaves(8);
this.base.setScale(0.02125f);
this.base.addModulator(new NoiseModulator() {

@Override
public float value(float... in) {
return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
}
});

FilteredBasis ground = new FilteredBasis(this.base);

this.perturb = new PerturbFilter();
this.perturb.setMagnitude(0.119f);

this.therm = new OptimizedErode();
this.therm.setRadius(5);
this.therm.setTalus(0.011f);

this.smooth = new SmoothFilter();
this.smooth.setRadius(1);
this.smooth.setEffect(0.7f);

this.iterate = new IterativeFilter();
this.iterate.addPreFilter(this.perturb);
this.iterate.addPostFilter(this.smooth);
this.iterate.setFilter(this.therm);
this.iterate.setIterations(1);

ground.addPreFilter(this.iterate);

this.terrain = new TerrainGrid("terrain", 65, 129, new FractalTileLoader(ground, 256f));

this.terrain.setMaterial(this.mat_terrain);
this.terrain.setLocalTranslation(0, 0, 0);
this.terrain.setLocalScale(2f, 1f, 2f);
this.rootNode.attachChild(this.terrain);


TerrainLodControl control = new TerrainGridLodControl(this.terrain, getCamera());
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier
this.terrain.addControl(control);
audio_gun = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false);
audio_gun.setLooping(false);
audio_gun.setVolume(2);
rootNode.attachChild(audio_gun);


bulletAppState.getPhysicsSpace().enableDebug(assetManager);

this.getCamera().setLocation(new Vector3f(0, 400, 0));
this.getCamera().lookAt(new Vector3f(0,0,0), Vector3f.UNIT_Y);

this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));

DirectionalLight light = new DirectionalLight();
light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
rootNode.addLight(light);

if (usePhysics) {
CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(0.5f, 2.5f, 1);
player3 = new CharacterControl(capsuleShape, 1.5f);
player3.setJumpSpeed(20);
player3.setFallSpeed(20);
player3.setGravity(30);

player3.setPhysicsLocation(new Vector3f(cam.getLocation().x, 256, cam.getLocation().z));

bulletAppState.getPhysicsSpace().add(player3);

terrain.addListener(new TerrainGridListener() {

public void gridMoved(Vector3f newCenter) {
}

public void tileAttached(Vector3f cell, TerrainQuad quad) {
while(quad.getControl(RigidBodyControl.class)!=null){
quad.removeControl(RigidBodyControl.class);
}
quad.addControl(new RigidBodyControl(new HeightfieldCollisionShape(quad.getHeightMap(), terrain.getLocalScale()), 0));
bulletAppState.getPhysicsSpace().add(quad);
}

public void tileDetached(Vector3f cell, TerrainQuad quad) {
bulletAppState.getPhysicsSpace().remove(quad);
quad.removeControl(RigidBodyControl.class);
}

});
}
fpp=new FilterPostProcessor(assetManager);
//fpp.setNumSamples(4);
fog=new FogFilter();
fog.setFogColor(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f));
fog.setFogDistance(155);
fog.setFogDensity(2.0f);
fpp.addFilter(fog);
rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false));
attatchBuildings(bulletAppState);
viewPort.addProcessor(fpp);
this.initKeys();


BitmapText crossHairs = new BitmapText(guiFont, false); // font size
crossHairs.setColor(ColorRGBA.White); // font color
crossHairs.setSize(guiFont.getCharSet().getRenderedSize() * 2);
crossHairs.setText("+"); // crosshairs
crossHairs.setLocalTranslation( // center
settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
settings.getHeight() / 2 + crossHairs.getLineHeight() / 2, 0);
guiNode.attachChild(crossHairs);

}

private void attatchBuildings(BulletAppState bulletAppState) {
building1_phy = new RigidBodyControl(0.0f);
assetManager.registerLocator("wildhouse.zip", ZipLocator.class);
Spatial scene1 = assetManager.loadModel("main.scene");
scene1.addControl(building1_phy);
bulletAppState.getPhysicsSpace().add(building1_phy);
building1_phy.setPhysicsLocation(new Vector3f(player3.getPhysicsLocation().x, 160, player3.getPhysicsLocation().z));
rootNode.attachChild(scene1);

}

private void initKeys() {
// You can map one or several inputs to one named action
this.inputManager.addMapping("Lefts", new KeyTrigger(KeyInput.KEY_A));
this.inputManager.addMapping("Rights", new KeyTrigger(KeyInput.KEY_D));
this.inputManager.addMapping("Ups", new KeyTrigger(KeyInput.KEY_W));
this.inputManager.addMapping("Downs", new KeyTrigger(KeyInput.KEY_S));
this.inputManager.addMapping("Jumps", new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addMapping("toggle", new KeyTrigger(KeyInput.KEY_Q));
inputManager.addMapping("DensityUp", new KeyTrigger(KeyInput.KEY_Y));
inputManager.addMapping("DensityDown", new KeyTrigger(KeyInput.KEY_H));
inputManager.addMapping("DistanceUp", new KeyTrigger(KeyInput.KEY_U));
inputManager.addMapping("DistanceDown", new KeyTrigger(KeyInput.KEY_J));
inputManager.addListener(this.actionListener, "toggle");
inputManager.addListener(this.anl, "DensityUp","DensityDown","DistanceUp","DistanceDown");
this.inputManager.addListener(this.actionListener, "Lefts");
this.inputManager.addListener(this.actionListener, "Rights");
this.inputManager.addListener(this.actionListener, "Ups");
this.inputManager.addListener(this.actionListener, "Downs");
this.inputManager.addListener(this.actionListener, "Jumps");
}
private boolean left;
private boolean right;
private boolean up;
private boolean down;
private final ActionListener actionListener = new ActionListener() {

@Override
public void onAction(final String name, final boolean keyPressed, final float tpf) {
if (name.equals("toggle") && keyPressed) {
if(enabled){
enabled=false;
viewPort.removeProcessor(fpp);
}else{
enabled=true;
viewPort.addProcessor(fpp);
}
} else if (name.equals("Lefts")) {
if (keyPressed) {
Beginning.this.left = true;
} else {
Beginning.this.left = false;
}
} else if (name.equals("Rights")) {
if (keyPressed) {
Beginning.this.right = true;
} else {
Beginning.this.right = false;
}
} else if (name.equals("Ups")) {
if (keyPressed) {
Beginning.this.up = true;
} else {
Beginning.this.up = false;
}
} else if (name.equals("Downs")) {
if (keyPressed) {
Beginning.this.down = true;
} else {
Beginning.this.down = false;
}
} else if (name.equals("Jumps")) {
Beginning.this.player3.jump();
}
}
};

AnalogListener anl=new AnalogListener() {

public void onAnalog(String name, float isPressed, float tpf) {
if(name.equals("DensityUp")){
fog.setFogDensity(fog.getFogDensity()+0.010f);
System.out.println("Fog density : "+fog.getFogDensity());
}
if(name.equals("DensityDown")){
fog.setFogDensity(fog.getFogDensity()-0.010f);
System.out.println("Fog density : "+fog.getFogDensity());
}
if(name.equals("DistanceUp")){
fog.setFogDistance(fog.getFogDistance()+0.5f);
System.out.println("Fog Distance : "+fog.getFogDistance());
}
if(name.equals("DistanceDown")){
fog.setFogDistance(fog.getFogDistance()-0.5f);
System.out.println("Fog Distance : "+fog.getFogDistance());
}

}
};


private final Vector3f walkDirection = new Vector3f();
int i = 0;
int npcs = 0;
@Override
public void simpleUpdate(final float tpf) {
if(i == 35) {
int X = Misc.random(50) - Misc.random(100);
int Y = Misc.random(10)+150;
int Z = Misc.random(50)- Misc.random(100);
Spatial zombie = assetManager.loadModel("Models/Zombie/test/zombie.mesh.xml");
//Material mat = new Material(assetManager, // Create new material and...
//"Common/MatDefs/Light/Lighting.j3md"); // ... specify .j3md file to use (illuminated).
//mat.setBoolean("UseMaterialColors",true); // Set some parameters, e.g. blue.
//mat.setColor("Ambient", ColorRGBA.Blue); // ... color of this object
//mat.setColor("Diffuse", ColorRGBA.Blue); // ... color of light being reflected // Use new material on this Geometry.
//zombie.setMaterial(mat);
zombie.scale(2.0f, 2.0f, 2.0f);
zombie.rotate(0.0f, -3.0f, 0.0f);
//zombie.setLocalTranslation(Misc.random(200) - Misc.random(400), Misc.random(130+70), Misc.random(200)- Misc.random(400));
RigidBodyControl zombie_phy = new RigidBodyControl(250f); // dynamic
zombie.addControl(zombie_phy);
zombie_phy.setRestitution(2.0f);
zombie_phy.setPhysicsLocation(new Vector3f(X,Y ,Z ));
rootNode.attachChild(zombie);
AnimControl control = zombie.getControl(AnimControl.class);
control.addListener(this);
AnimChannel channel = control.createChannel();
channel.setAnim("test");
audio_gun.playInstance();
bulletAppState.getPhysicsSpace().add(zombie_phy);
i=0;
npcs++;
System.out.println(npcs+" npcs in the world.");
}
i++;


showGui();
Vector3f camDir = this.cam.getDirection().clone().multLocal(0.6f);
Vector3f camLeft = this.cam.getLeft().clone().multLocal(0.4f);
this.walkDirection.set(0, 0, 0);
if (this.left) {
this.walkDirection.addLocal(camLeft);
}
if (this.right) {
this.walkDirection.addLocal(camLeft.negate());
}
if (this.up) {
this.walkDirection.addLocal(camDir);
}
if (this.down) {
this.walkDirection.addLocal(camDir.negate());
}

if (usePhysics) {
this.player3.setWalkDirection(this.walkDirection);
this.cam.setLocation(this.player3.getPhysicsLocation());
}
}

private void showGui() {
if(guiNode.getChild(1) != null)
guiNode.detachChildAt(1);
BitmapText hudText = new BitmapText(guiFont, false);
hudText.setSize(guiFont.getCharSet().getRenderedSize()-3); // font size
hudText.setColor(ColorRGBA.White);
hudText.setText("Q - Toggle Fog | Y - Density Up | H - Density Down | U - Distance Up | J - Distance Down | ( "+player3.getPhysicsLocation().x+", "+player3.getPhysicsLocation().z+", "+player3.getPhysicsLocation().y+" )"); // the text
hudText.setLocalTranslation(125, hudText.getLineHeight(), 0); // position
guiNode.attachChildAt(hudText,1);
}

public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
if (animName.equals("test")){
channel.setAnim("test", 0.50f);
channel.setLoopMode(LoopMode.DontLoop);
channel.setSpeed(1f);
}
}

public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
}


}
[/java]


If anyone could help, I would greatly appreciate it.

Update to the latest drivers from the graphics card manufacturer. That is not the “Windows Update” ones.

It worked, thank you very much! How do you think this would affect distribution?

@jamestice said:
It worked, thank you very much! How do you think this would affect distribution?

:? The distribution format doesn't change because of your graphics driver?

Yeah, I guess I should have worded that better :roll:



Would I need to have it UV mapped to be able to convert it to j3o when I finally release it? Currently, I believe it’s getting the textures from the material file (I could be wrong?)



As for the graphics drivers, I think I’m going to have try-catch so if it catches the exception I was getting, it takes them to a page telling them how to update their drivers. Thanks for your help already though, I feel I’m going to be liking the community more than I thought. :slight_smile:

a) You seem to have some things mixed up or a wrong idea, don’t worry about things like distribution or optimization too early, especially when new to development in the specific environment :slight_smile:

b) Yes, you can just override handleError() in the application class and… handle the error :wink: