Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cowbox

Pages: 1 2 [3] 4
31
Support / Texture reloading just turns objects white
« on: October 15, 2012, 04:23:37 pm »
Same voxel engine as the last thread I made.

All I'm trying to do is implement saving and loading.

Saving works, a little slower than I had expected, but at least outputs files in .png with ARGB.

Loading the textures for all the layers of voxels only works the first time when I run this method:
Code: [Select]
private void loadWorld(String name)
{
System.out.println("Loading "+name);
// Load each layer image
for(int i=0;i<layerNumber;i++)
{
Texture t=new Texture("user/"+name+"/layer"+i+".png",true);
Texture t2=new Texture("user/"+name+"/layer"+i+".png",true);
t.setGLFiltering(false);
tm.removeTexture("layer"+i);
tm.removeTexture("layerg"+i);
tm.addTexture("layer"+i,t);
tm.addTexture("layerg"+i,t2);
ids[i]=tm.getTextureID("layer"+i);
idgs[i]=tm.getTextureID("layerg"+i);
layers[i]=new TextureInfo(ids[i]);
layers[i].add(tm.getTextureID("floorTexN"),TextureInfo.MODE_MODULATE);
layergs[i]=new TextureInfo(idgs[i]);
pics[i]=Toolkit.getDefaultToolkit().getImage("user/"+name+"/layer"+i+".png");
}
System.out.println("Loaded "+name);
}
(ids and idgs, are just for storing the layer IDs for faster editing elsewhere (so it's not searching for strings))

The second time I run it, all the objects those textures apply to are just plain white. D:

What is going wrong then? What should I be doing?

NOTE:
I tried using replaceTexture but all that did was replace it then reload it from the first instance it loaded the second I tried editing... So I thought I'd go down a more manual route and it's just getting me to an obvious error I can recreate than the glitchy replacement problems replaceTexture was giving me. :P

Haaaaaaaalp :'( (plz)

32
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 07:41:53 pm »
Twud be cooler if I could work out a more efficient way to edit the voxels (it takes a few milliseconds at the moment to transfer all the image data into all the silly kinds of buffers and back to textures, so there's a lag spike at every interaction) or if I could find a more efficient way to draw 100 to 400 different plains all with a 1024x1024 texture with/without texture filtering (because even on my relatively good desktop, I only get like 60-70FPS on what I consider "normal" settings for the engine). xD

33
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 06:12:37 pm »
Aha!

For some reason, what you said "did" actually affect the outcome, I was just thrown off by the fact the windows update seemed to have changed everything. (Maybe they phased out some kind of OGL backwards compatibility or something.)

I've now fixed the shader so that it does what I "actually" intended, whilst being syntactically correct.

Code: [Select]
varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform float invRadius;
uniform float specPow;

void main (void)
{
float distSqr = dot(lightVec, lightVec);
float att = clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0);
vec3 lVec = lightVec * inversesqrt(distSqr);
vec3 lLev = vec3(2.0, 2.0, 2.0);

vec3 vVec = normalize(eyeVec);
vec4 base = texture2D(colorMap, texCoord);
vec3 bump = normalize(texture2D(normalMap, texCoord*64).xyz * 2.0 - 1.0);

vec4 vAmbient = gl_LightSource[0].ambient * gl_FrontMaterial.ambient;

float diffuse = max(dot(lLev, bump), 0.0);
vec4 vDiffuse = gl_LightSource[0].diffuse * gl_FrontMaterial.diffuse * diffuse;

float specular = pow(clamp(dot(reflect(-lVec, bump), vVec), 0.0, specPow), gl_FrontMaterial.shininess);
vec4 vSpecular = gl_LightSource[0].specular * gl_FrontMaterial.specular * specular;

gl_FragColor = (vAmbient*base + vDiffuse*base + vSpecular) * att;
}

Now my voxel engine can thrive once more! (With normal mapping)

Thanks for the help :D

34
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 05:57:43 pm »
Well, all that line was meant to be doing was to increase the brightness of the shader (because I couldn't work out the lighting) and it seemed to work on my desktop.

I don't really know how to code GLSL so I tried until it worked. :D

The annoying part about all of this is that it still doesn't work even if I revert the changes or use the original shader from the advanced example. D:

So I don't know where I should be looking to fix things, because as far as I can tell this isn't actually the problem. :(

EDIT:
Also, as well as this, I only updated my graphics drivers "after" this problem started occuring, to see if it would fix it. :(

The only thing that's actually changed is the Windows update (and time passage). D:

35
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 05:41:22 pm »
Not sure if this is what you mean but I turned the logger back to default settings and here is the console output:
Code: [Select]
run:
Loading Texture...res/digger.png
Loading Texture...res/shader/floorN.png
[ Thu Oct 11 16:40:22 BST 2012 ] - WARNING: Unsupported Texture width (640)...resizing to a width of 256 pixels!
Loading Texture...res/shading.png
Loading Texture...res/map/layer0.png
Loading Texture...res/map/layer0.png
Loading Texture...res/map/layer1.png
Loading Texture...res/map/layer1.png
Loading Texture...res/map/layer2.png
Loading Texture...res/map/layer2.png
Loading Texture...res/map/layer3.png
Loading Texture...res/map/layer3.png
Loading Texture...res/map/layer4.png
Loading Texture...res/map/layer4.png
Loading Texture...res/map/layer5.png
Loading Texture...res/map/layer5.png
Loading Texture...res/map/layer6.png
Loading Texture...res/map/layer6.png
Loading Texture...res/map/layer7.png
Loading Texture...res/map/layer7.png
Loading Texture...res/map/layer8.png
Loading Texture...res/map/layer8.png
Loading Texture...res/map/layer9.png
Loading Texture...res/map/layer9.png
Loading Texture...res/map/layer10.png
Loading Texture...res/map/layer10.png
Loading Texture...res/map/layer11.png
Loading Texture...res/map/layer11.png
Loading Texture...res/map/layer12.png
Loading Texture...res/map/layer12.png
Loading Texture...res/map/layer13.png
Loading Texture...res/map/layer13.png
Loading Texture...res/map/layer14.png
Loading Texture...res/map/layer14.png
Loading Texture...res/map/layer15.png
Loading Texture...res/map/layer15.png
Loading Texture...res/map/layer16.png
Loading Texture...res/map/layer16.png
Loading Texture...res/map/layer17.png
Loading Texture...res/map/layer17.png
Loading Texture...res/map/layer18.png
Loading Texture...res/map/layer18.png
Loading Texture...res/map/layer19.png
Loading Texture...res/map/layer19.png
Loading file res/shader/genericf.glsl
Text file res/shader/genericf.glsl loaded...1032 bytes
Loading file res/shader/genericv.glsl
Text file res/shader/genericv.glsl loaded...962 bytes
Java version is: 1.7.0_07
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
mode: 320/240/16/60
mode: 640/400/16/60
mode: 1280/720/16/60
mode: 1280/600/16/60
mode: 320/200/32/60
mode: 1366/768/16/60
mode: 512/384/16/60
mode: 1360/768/16/60
mode: 400/300/16/60
mode: 1366/768/32/60
mode: 512/384/32/60
mode: 1360/768/32/60
mode: 400/300/32/60
mode: 320/240/32/60
mode: 640/400/32/60
mode: 320/200/16/60
mode: 1280/600/32/60
mode: 1280/720/32/60
mode: 1280/768/16/60
mode: 800/600/16/60
mode: 640/480/32/60
mode: 1024/768/16/60
mode: 1024/768/32/60
mode: 800/600/32/60
Current mode:800 x 600 x 32 @60Hz
[ Thu Oct 11 16:40:25 BST 2012 ] - WARNING: ZBuffer depth of 32 not supported - trying something else now...!
[ Thu Oct 11 16:40:25 BST 2012 ] - WARNING: ZBuffer depth is now set to 16bpp!
Driver is: igdumd64/8.15.10.2761 on Intel / Intel(R) HD Graphics
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
VBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Hardware supports textures up to 8192*8192 in size!
Adding Lightsource: 0
New WorldProcessor created using 1 thread(s) and granularity of 1!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 0/object2 compiled using 6 vertices in 1ms!
Object 0/object2 compiled to 1 subobjects in 7ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 1/object3 compiled using 6 vertices in 0ms!
Object 1/object3 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 2/object4 compiled using 6 vertices in 0ms!
Object 2/object4 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 3/object5 compiled using 6 vertices in 0ms!
Object 3/object5 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 4/object6 compiled using 6 vertices in 0ms!
Object 4/object6 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 5/object7 compiled using 6 vertices in 0ms!
Object 5/object7 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 6/object8 compiled using 6 vertices in 0ms!
Object 6/object8 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 7/object9 compiled using 6 vertices in 0ms!
Object 7/object9 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 8/object10 compiled using 6 vertices in 0ms!
Object 8/object10 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 9/object11 compiled using 6 vertices in 0ms!
Object 9/object11 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 10/object12 compiled using 6 vertices in 0ms!
Object 10/object12 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 11/object13 compiled using 6 vertices in 0ms!
Object 11/object13 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled using 6 vertices in 0ms!
Object 12/object14 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 13/object15 compiled using 6 vertices in 0ms!
Object 13/object15 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 14/object16 compiled using 6 vertices in 0ms!
Object 14/object16 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 15/object17 compiled using 6 vertices in 0ms!
Object 15/object17 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 16/object18 compiled using 6 vertices in 0ms!
Object 16/object18 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 17/object19 compiled using 6 vertices in 0ms!
Object 17/object19 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 18/object20 compiled using 6 vertices in 0ms!
Object 18/object20 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 19/object21 compiled using 6 vertices in 1ms!
Object 19/object21 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 20/object22 compiled using 6 vertices in 0ms!
Object 20/object22 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 21/object23 compiled using 6 vertices in 3ms!
Object 21/object23 compiled to 1 subobjects in 4ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 22/object24 compiled using 6 vertices in 0ms!
Object 22/object24 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 23/object25 compiled using 6 vertices in 0ms!
Object 23/object25 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 24/object26 compiled using 6 vertices in 0ms!
Object 24/object26 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 25/object27 compiled using 6 vertices in 1ms!
Object 25/object27 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 26/object28 compiled using 6 vertices in 0ms!
Object 26/object28 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 27/object29 compiled using 6 vertices in 0ms!
Object 27/object29 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 28/object30 compiled using 6 vertices in 1ms!
Object 28/object30 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 29/object31 compiled using 6 vertices in 0ms!
Object 29/object31 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 30/object32 compiled using 6 vertices in 0ms!
Object 30/object32 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 31/object33 compiled using 6 vertices in 0ms!
Object 31/object33 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 32/object34 compiled using 6 vertices in 0ms!
Object 32/object34 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 33/object35 compiled using 6 vertices in 0ms!
Object 33/object35 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 34/object36 compiled using 6 vertices in 0ms!
Object 34/object36 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 35/object37 compiled using 6 vertices in 0ms!
Object 35/object37 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 36/object38 compiled using 6 vertices in 0ms!
Object 36/object38 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 37/object39 compiled using 6 vertices in 0ms!
Object 37/object39 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 38/object40 compiled using 6 vertices in 0ms!
Object 38/object40 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 39/object41 compiled using 6 vertices in 0ms!
Object 39/object41 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 40/object42 compiled using 6 vertices in 0ms!
Object 40/object42 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 41/object43 compiled using 6 vertices in 0ms!
Object 41/object43 compiled to 1 subobjects in 20ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 42/object44 compiled using 6 vertices in 0ms!
Object 42/object44 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 43/object45 compiled using 6 vertices in 0ms!
Object 43/object45 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 44/object46 compiled using 6 vertices in 0ms!
Object 44/object46 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 45/object47 compiled using 6 vertices in 0ms!
Object 45/object47 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 46/object48 compiled using 6 vertices in 0ms!
Object 46/object48 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 47/object49 compiled using 6 vertices in 0ms!
Object 47/object49 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 48/object50 compiled using 6 vertices in 0ms!
Object 48/object50 compiled to 1 subobjects in 10ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 49/object51 compiled using 6 vertices in 0ms!
Object 49/object51 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 50/object52 compiled using 6 vertices in 0ms!
Object 50/object52 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 51/object53 compiled using 6 vertices in 0ms!
Object 51/object53 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 52/object54 compiled using 6 vertices in 0ms!
Object 52/object54 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 53/object55 compiled using 6 vertices in 0ms!
Object 53/object55 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 54/object56 compiled using 6 vertices in 0ms!
Object 54/object56 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 55/object57 compiled using 6 vertices in 0ms!
Object 55/object57 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 56/object58 compiled using 6 vertices in 0ms!
Object 56/object58 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 57/object59 compiled using 6 vertices in 0ms!
Object 57/object59 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 58/object60 compiled using 6 vertices in 0ms!
Object 58/object60 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 59/object61 compiled using 6 vertices in 0ms!
Object 59/object61 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 60/object62 compiled using 6 vertices in 0ms!
Object 60/object62 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 61/object63 compiled using 6 vertices in 0ms!
Object 61/object63 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 62/object64 compiled using 6 vertices in 0ms!
Object 62/object64 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 63/object65 compiled using 6 vertices in 0ms!
Object 63/object65 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 64/object66 compiled using 6 vertices in 0ms!
Object 64/object66 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 65/object67 compiled using 6 vertices in 0ms!
Object 65/object67 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 66/object68 compiled using 6 vertices in 0ms!
Object 66/object68 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 67/object69 compiled using 6 vertices in 0ms!
Object 67/object69 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 68/object70 compiled using 6 vertices in 0ms!
Object 68/object70 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 69/object71 compiled using 6 vertices in 0ms!
Object 69/object71 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 70/object72 compiled using 6 vertices in 0ms!
Object 70/object72 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 71/object73 compiled using 6 vertices in 1ms!
Object 71/object73 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 72/object74 compiled using 6 vertices in 0ms!
Object 72/object74 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 73/object75 compiled using 6 vertices in 0ms!
Object 73/object75 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 74/object76 compiled using 6 vertices in 0ms!
Object 74/object76 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 75/object77 compiled using 6 vertices in 0ms!
Object 75/object77 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 76/object78 compiled using 6 vertices in 0ms!
Object 76/object78 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 77/object79 compiled using 6 vertices in 0ms!
Object 77/object79 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 78/object80 compiled using 6 vertices in 0ms!
Object 78/object80 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 79/object81 compiled using 6 vertices in 0ms!
Object 79/object81 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 80/object82 compiled using 6 vertices in 0ms!
Object 80/object82 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 81/object83 compiled using 6 vertices in 1ms!
Object 81/object83 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 82/object84 compiled using 6 vertices in 0ms!
Object 82/object84 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 83/object85 compiled using 6 vertices in 0ms!
Object 83/object85 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 84/object86 compiled using 6 vertices in 0ms!
Object 84/object86 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 85/object87 compiled using 6 vertices in 0ms!
Object 85/object87 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 86/object88 compiled using 6 vertices in 0ms!
Object 86/object88 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 87/object89 compiled using 6 vertices in 0ms!
Object 87/object89 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 88/object90 compiled using 6 vertices in 0ms!
Object 88/object90 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 89/object91 compiled using 6 vertices in 0ms!
Object 89/object91 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 90/object92 compiled using 6 vertices in 0ms!
Object 90/object92 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 91/object93 compiled using 6 vertices in 0ms!
Object 91/object93 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 92/object94 compiled using 6 vertices in 0ms!
Object 92/object94 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 93/object95 compiled using 6 vertices in 0ms!
Object 93/object95 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 94/object96 compiled using 6 vertices in 1ms!
Object 94/object96 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 95/object97 compiled using 6 vertices in 0ms!
Object 95/object97 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 96/object98 compiled using 6 vertices in 0ms!
Object 96/object98 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 97/object99 compiled using 6 vertices in 0ms!
Object 97/object99 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 98/object100 compiled using 6 vertices in 0ms!
Object 98/object100 compiled to 1 subobjects in 0ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 99/object101 compiled using 6 vertices in 1ms!
Object 99/object101 compiled to 1 subobjects in 1ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 100/object102 compiled using 48 vertices in 1ms!
Object 100/object102 compiled to 1 subobjects in 1ms!
Additional visibility list (2) created with size: 1000
Creating new world processor buffer for thread main
VBO created for object 'object26'
VBO created for object 'object98'
VBO created for object 'object90'
VBO created for object 'object101'
VBO created for object 'object76'
VBO created for object 'object58'
VBO created for object 'object93'
VBO created for object 'object49'
VBO created for object 'object36'
VBO created for object 'object13'
VBO created for object 'object77'
VBO created for object 'object86'
VBO created for object 'object59'
VBO created for object 'object83'
VBO created for object 'object80'
VBO created for object 'object102'
VBO created for object 'object87'
VBO created for object 'object5'
VBO created for object 'object75'
VBO created for object 'object29'
VBO created for object 'object81'
VBO created for object 'object46'
VBO created for object 'object15'
VBO created for object 'object40'
VBO created for object 'object97'
VBO created for object 'object92'
VBO created for object 'object68'
VBO created for object 'object17'
VBO created for object 'object82'
VBO created for object 'object88'
VBO created for object 'object14'
VBO created for object 'object44'
VBO created for object 'object56'
VBO created for object 'object95'
VBO created for object 'object57'
VBO created for object 'object63'
VBO created for object 'object99'
VBO created for object 'object38'
VBO created for object 'object4'
VBO created for object 'object21'
VBO created for object 'object54'
VBO created for object 'object85'
VBO created for object 'object96'
VBO created for object 'object33'
VBO created for object 'object16'
VBO created for object 'object74'
VBO created for object 'object66'
VBO created for object 'object35'
VBO created for object 'object30'
VBO created for object 'object11'
VBO created for object 'object34'
VBO created for object 'object67'
VBO created for object 'object52'
VBO created for object 'object48'
VBO created for object 'object84'
VBO created for object 'object31'
VBO created for object 'object19'
VBO created for object 'object12'
VBO created for object 'object73'
VBO created for object 'object3'
VBO created for object 'object25'
VBO created for object 'object64'
VBO created for object 'object72'
VBO created for object 'object42'
VBO created for object 'object10'
VBO created for object 'object91'
VBO created for object 'object71'
VBO created for object 'object41'
VBO created for object 'object79'
VBO created for object 'object9'
VBO created for object 'object22'
VBO created for object 'object43'
VBO created for object 'object37'
VBO created for object 'object51'
VBO created for object 'object65'
VBO created for object 'object45'
VBO created for object 'object2'
VBO created for object 'object23'
VBO created for object 'object24'
VBO created for object 'object50'
VBO created for object 'object7'
VBO created for object 'object32'
VBO created for object 'object20'
VBO created for object 'object47'
VBO created for object 'object27'
VBO created for object 'object39'
VBO created for object 'object100'
VBO created for object 'object18'
VBO created for object 'object69'
VBO created for object 'object89'
VBO created for object 'object62'
VBO created for object 'object60'
VBO created for object 'object94'
VBO created for object 'object53'
VBO created for object 'object78'
VBO created for object 'object6'
VBO created for object 'object55'
VBO created for object 'object61'
VBO created for object 'object28'
VBO created for object 'object70'
VBO created for object 'object8'
Compiled 101 VBO!
Allocating 4194304 bytes of direct memory for texture: com.threed.jpct.Texture@7cc2f262
Caching 4194304 bytes of direct memory!
Allocating 262144 bytes of direct memory for texture: com.threed.jpct.Texture@544bbff1
Caching 262144 bytes of direct memory!
Software renderer disposed
WARNING: 0:18: 'assign' : implict conversion between types allowed from GLSL 1.20
WARNING: 0:23: 'dot' : implicit conversion is allowed from GLSL 1.20
ERROR: 0:23: 'dot' : no matching overloaded function found (using implicit conversion)


No errors.

[ Thu Oct 11 16:40:27 BST 2012 ] - ERROR:
Exception in thread "main" org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at org.lwjgl.opengl.GL20.glGetAttribLocation(GL20.java:1101)
at com.threed.jpct.GLSLShader.init(Unknown Source)
at com.threed.jpct.GLSLShader.beforeRendering(Unknown Source)
at com.threed.jpct.CompiledInstance.render(Unknown Source)
at com.threed.jpct.GLRenderer.drawVertexArray(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.util.ShadowHelper.drawScene(Unknown Source)
at com.threed.jpct.util.ShadowHelper.drawScene(Unknown Source)
at voxeng5.Voxeng5.gameLoop(Voxeng5.java:256)
at voxeng5.Voxeng5.main(Voxeng5.java:49)
Java Result: 1
BUILD SUCCESSFUL (total time: 6 seconds)

Doesn't really say anything more than the first output I'm afraid. :(

All the stuff at the end was being output last time it worked as far as I'm aware.

36
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 05:00:41 pm »
Version 1.25 :(

This project has been made in the last few days, and I downloaded jPCT like a week or 2 ago to start a fresh with it. D:

Things were going so well, but now suddenly my laptop doesn't want to use shaders with it.

As I said, this was all working perfectly like 24 hours ago, but today, I've loaded up my project after a Windows update and now it doesn't work. D: (Darn Microsoft)

37
Support / Re: Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 03:44:06 pm »
Ok, I've identified the problem goes away if I disable all the shaders.

Why would this cause such an issue in such a short period of time?

The shader I'm using is an edited version of the one that comes with the advanced example tutorial:
Code: [Select]
varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform float invRadius;
uniform float specPow;

void main (void)
{
float distSqr = dot(lightVec, lightVec);
float att = clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0);
vec3 lVec = lightVec * inversesqrt(distSqr);

vec3 vVec = normalize(eyeVec);
vec4 base = texture2D(colorMap, texCoord);
vec3 bump = normalize(texture2D(normalMap, texCoord*64).xyz * 2.0 - 1.0);

vec4 vAmbient = gl_LightSource[0].ambient * gl_FrontMaterial.ambient;

//float diffuse = max(dot(lVec, bump), 0.0);
float diffuse = max(dot(2.0, bump), 0.0);
vec4 vDiffuse = gl_LightSource[0].diffuse * gl_FrontMaterial.diffuse * diffuse;

float specular = pow(clamp(dot(reflect(-lVec, bump), vVec), 0.0, specPow), gl_FrontMaterial.shininess);
vec4 vSpecular = gl_LightSource[0].specular * gl_FrontMaterial.specular * specular;

gl_FragColor = (vAmbient*base + vDiffuse*base + vSpecular) * att;
}
- genericf.glsl

Code: [Select]
varying vec4 diffuse,ambient;
varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

void main(void)
{
gl_Position = ftransform();
texCoord = gl_MultiTexCoord0.xy;

// jPCT doesn't provide the tangent vector...compute it (this isn't 100% accurate...)

vec3 c1 = cross(gl_Normal, vec3(0.0, 0.0, 1.0));
vec3 c2 = cross(gl_Normal, vec3(0.0, 1.0, 0.0));

vec3 vTangent=c1;
if (length(c2)>length(vTangent)) {
vTangent=c2;
}

vTangent = normalize(vTangent);

vec3 n = normalize(gl_NormalMatrix * gl_Normal);
vec3 t = normalize(gl_NormalMatrix * vTangent);
vec3 b = cross(n, t);

vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
vec3 tmpVec = gl_LightSource[0].position.xyz - vVertex;

lightVec.x = dot(tmpVec, t);
lightVec.y = dot(tmpVec, b);
lightVec.z = dot(tmpVec, n);

tmpVec = -vVertex;
eyeVec.x = dot(tmpVec, t);
eyeVec.y = dot(tmpVec, b);
eyeVec.z = dot(tmpVec, n);
}
- genericv.glsl

However! Even if I substitute the exact shader used in that example (which still works for some reason), "my" projects don't. D:

What's going on?

Will I be able to get my normal mapping back :(?

38
Support / Help D: Suddenly after a windows update jPCT doesn't work
« on: October 11, 2012, 03:16:47 pm »
D:

I've been coding with jPCT in Java7 on Windows7x64 fine until yesterday.

I copied my project from my desktop (on exactly the same settings^) to carry on coding on my laptop today.

Windows installed an update and suddenly none of my jPCT projects work anymore. :(

It's moaning about commands like world.draw();

Here's the error log on my main project (it worked fine yesterday, the only change has been the windows update):

Code: [Select]
run:
[ Thu Oct 11 14:12:19 BST 2012 ] - ERROR:
Exception in thread "main" org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at org.lwjgl.opengl.GL20.glGetAttribLocation(GL20.java:1101)
at com.threed.jpct.GLSLShader.init(Unknown Source)
at com.threed.jpct.GLSLShader.beforeRendering(Unknown Source)
at com.threed.jpct.CompiledInstance.render(Unknown Source)
at com.threed.jpct.GLRenderer.drawVertexArray(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.World.draw(Unknown Source)
at com.threed.jpct.util.ShadowHelper.drawScene(Unknown Source)
at com.threed.jpct.util.ShadowHelper.drawScene(Unknown Source)
at voxeng5.Voxeng5.gameLoop(Voxeng5.java:256)
at voxeng5.Voxeng5.main(Voxeng5.java:49)
Java Result: 1
BUILD SUCCESSFUL (total time: 6 seconds)

I've tried updating the drivers and restarting, that didn't work.
I've tried changing the code from shad.draw() and all the complicated shadow handling to just world.draw(), that didn't work.
I've checked my OpenGL version: 3.1

What do I do?????????

:(

39
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 08, 2012, 01:24:30 pm »
Aha! xD

Finally, we've found the problem.

I knew it'd be something derpy like that. :D

Thanx, now I can go make stuff :D:D:D:D

40
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 08, 2012, 01:08:32 pm »
Lol my code's really not that long at all...

I've already pasted everything I'm doing to wall1 in this thread.

I wasn't using setRotationPivot until before you started telling me to, so the only places it's going to be are either on the engine related props (which I'm pretty sure I subsequently removed) or on the 4 walls I've used to show this problem.

Here's a big paste of the entire code if it makes any headway on this. xD
http://slexy.org/raw/s2mXZOlk3r

There's only one other source file and that's for handling sound. (I haven't managed to make the engine any more streamlined because of problems like this getting in my way every 10 lines xD)

Extra:
Just realised I've left the pivots set to -6,0,-6 in that but I can assure you, the console output is still reading 5,0,5 regardless of whatever I put in there... xD

And here's a picture showing just that:

41
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 08, 2012, 11:48:32 am »
Well I can't be setting it on clones for this object.

I made sure of that by only using wall1 for this purpose; the rest of the engine is being handled elsewhere and isn't being touched.

That's the complete code up there for wall1^, and I'm definitely calling build. :S

I've also tried loads of combinations of build before and after setting the pivot, not building at all, rebuilding, unbuilding.

Nothing's making any difference, the pivot still comes out at 5,0,5 regardless. :S

42
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 08, 2012, 09:47:02 am »
Ah yeah, there's the problem, clear as day.

I've got the following code:
Code: [Select]
String type="obj";
String path="corner";
wall1=Object3D.mergeAll(Loader.loadOBJ("res/"+type+"/"+path+"/"+path+"."+type,"",0.125f));
wall1.build();
wall1.setRotationPivot(new SimpleVector(0,0,0));
wall1.translate(0,-10,0);
world.addObject(wall1);

Yet when I use:
Code: [Select]
System.out.println(wall1.getRotationPivot());in the main loop, I get:
(5.0,0.0,5.0)

How is this managing to happen D:?

Here is the corner model I'm using (with a cube bounding box around 0,0,0 in our modelling programs):
http://www.soharix.homestead.com/java/corner.obj - This was exported by my modeller from Cinema4D I believe
Here is a very similar object that I made myself in Deled:
http://www.soharix.homestead.com/java/corner.3ds

Extra:

Nothing changes if I add the line wall1.setCenter(new SimpleVector(0,0,0));

And perhaps what's more concerning is that nothing changes if I try this:
Code: [Select]
wall1.setCenter(new SimpleVector(-5,0,-5));
wall1.setRotationPivot(new SimpleVector(-5,0,-5));
The pivot still turns out at 5,0,5. D:

43
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 07, 2012, 07:51:17 pm »
Well I can't say I didn't see that coming.

Doing build() then setRotationPivot(new SimpleVector(0,0,0)) changes absolutely nothing and everything's still rotating about a completely random point. (I've tried this on both .3ds and .obj being exported from Cinema4D and Deled, both programs can find the pivot point/0,0,0 fine.)

The annoying thing about the point jPCT is getting is that it isn't even being calculated properly based on the vertices available.

I've got models that essentially end up with cube shaped bounding boxes and yet their rotation point is like some kind of half measurement: it's not the real centre of the cube.

Why is this so difficult... xD All I want to do is rotate everything around 0,0,0 like every other 3D engine/program I've ever encountered does.

44
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 07, 2012, 02:42:46 pm »
The problem is that the objects are not rotating around 0,0,0 once they've been loaded into jPCT.

Achieving this seems to be the most difficult task on the planet as it doesn't work in .3ds with or without the Config.useRotationPivotFrom3DS method or for .obj.

I also don't really understand how one is supposed to set the pivot manually as it would surely be relative to 0,0,0 and setting the pivot to be 0,0,0 therefore seems like it'd already be the default values.

45
Support / Re: Rotation of asymmetrical 3ds object problem
« on: February 07, 2012, 01:43:14 pm »
Right, I'm back. I got a bit distracted for a few days.

I tried looking for the pivot in the log output and couldn't see anything.

This problem is really starting to annoy me now because it basically means I can't actually do anything in this engine anymore.

We switched to .obj because we thought it was a problem with .3ds but exactly the same problem is occurring.

Here is a screenshot showing the centre of rotation on a corner object I'm trying to use in Deled:


And here are 4 of them stacked on top of each other (at 0,-10,0; 0,-20,0; 0,-30,0; and 0,-40,0; at rotations 0 degrees, 90 degrees, 180 degrees and 270 degrees respectively):

As you can see, the 4 objects are not rotating around the pivot point shown in Deled. (Those back 2 squares should be horizontally aligned.)

What do I do now D:?

Pages: 1 2 [3] 4