Skyfail

I’ve been trying to use something else besides the BrightSky.dds for my skybox and everything I try gives me;



ERRORS

[java]Oct 15, 2010 4:03:45 AM com.jme3.renderer.lwjgl.LwjglRenderer updateTextureData

WARNING: Invalid texture: TextureCubeMap[name=Textures/Sky/Night/Night_dxt1.dds, img=1024x1024-DXT1/mips]

Cubemap textures must contain 6 data units.[/java]



[java]Oct 15, 2010 4:03:07 AM com.jme3.renderer.lwjgl.LwjglRenderer updateTextureData

WARNING: Invalid texture: TextureCubeMap[name=Textures/Sky/Night/Night_ycc.dds, img=1024x1024-DXT5/mips]

Cubemap textures must contain 6 data units.[/java]



Offending Code?

[java] Sphere sphereMesh = new Sphere(32, 32, 10, false, true);

Geometry sphere = new Geometry(“Sky”, sphereMesh);

sphere.setQueueBucket(Bucket.Sky);

Material sky = new Material(assetManager, “Common/MatDefs/Misc/Sky.j3md”);

TextureKey key = new TextureKey(“Textures/Sky/Night/Night_dxt1.dds”, true);

key.setGenerateMips(true);

key.setAsCube(true);

Texture tex = assetManager.loadTexture(key);

sky.setTexture(“m_Texture”, tex);

sky.setVector3(“m_NormalScale”, Vector3f.UNIT_XYZ);

sphere.setMaterial(sky);

sphere.setCullHint(CullHint.Never);

rootNode.attachChild(sphere);[/java]

The problem is not in the code. Your texture is not a cubemap.

try this



sky.setBoolean(“m_SphereMap”, true);



it will map your image to a sphere instead of looking for a cubemap.



If you want to create your own cubemap see this thread :

http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/creating-my-own-skydome-images/

@nehon thank you again and again (other posts). That got my sky showing which is good enough for me for now. However the texture is stretched at one end of the sphere, as if it originates from a point in the side, the other opposite side is fine. Sorry I’m such a newbie at this.



Code

[java] Sphere sphereMesh = new Sphere(32, 32, 10, false, true);

Geometry sphere = new Geometry(“Sky”, sphereMesh);

sphere.setQueueBucket(Bucket.Sky);

Material sky = new Material(assetManager, “Common/MatDefs/Misc/Sky.j3md”);

TextureKey key = new TextureKey(“Textures/Sky/Night/Andromeda.dds”, true);

key.setGenerateMips(true);

//key.setAsCube(true);

sky.setBoolean(“m_SphereMap”, true);

Texture tex = assetManager.loadTexture(key);

sky.setTexture(“m_Texture”, tex);

sky.setVector3(“m_NormalScale”, Vector3f.UNIT_XYZ);

sphere.setMaterial(sky);

sphere.setCullHint(CullHint.Never);

rootNode.attachChild(sphere);[/java]

Mhh I had a similar issue, my sky texture was in polar coordinates to fit a sky dome.

Those kind of textures doesn’t fit very well to spheres.

Maybe that’s also the case for you?

That could very well be, as least with your correction I can try other textures and find a good one.



Another question, how would you recommend I simulate darkness, like a creepy outdoor darkness? I tried changing the directional light’s properties to make it a greyer shade and cut the alpha but the terrain still is just as illuminated. I want the viewing plane to basically obfuscate at a certain distance, but i want terrain to still be visible, nighttime where zombies can flourish! If you have any ideas, they would be greatly appreciated. Between you, levia, normen, and zathras(sp) you fellas address so many of my novice java questions that it really just keeps me programming.

Please, try to keep one question/topic for one thread, other people are likely to come by the same problems as you, and mixing topics can be confusing when searching the forum.

We cannot split threads (at least i don’t know how to do it), so please, could you post this question in another thread, i’ll answer it as best as i can.

sarophym said:(...)
Another question,
Let me stop you right there. It's great that you are making progress, but with the amount of support you are receiving, I hope you will to your best to give something back. It's pretty simple: Make a new thread when your problem is solved :) A forum is all about recyclable knowledge, and by adding multiple topics to one thread like you're doing now (skybox problem + darkness simulation), you are making it harder for new visitors to find the topics they're interested in. So:

#1 - Please make longer, descriptive titles
#2 - Please stick to one problem, then move on to make a new thread when your problem is solved.

Edit: ...what he said :P damn your French agility.

http://hub.jmonkeyengine.org/groups/effects/forum/topic/simulating-darkness/



Gotcha, started a new thread, I’ll do that in that from now on. I knew when I started that question it was probably a poor decision.

erlend_sh said:
Edit: ...what he said :P damn your French agility.

Normen is teaching me mind reading, and replying at light pace! But i'm just a beginner :p
sarophym said:
http://hub.jmonkeyengine.org/groups/effects/forum/topic/simulating-darkness/

Gotcha, started a new thread, I'll do that in that from now on. I knew when I started that question it was probably a poor decision.

Cheers mate :)

Oh nehon, it feels like only yesterday you were happy just bending a couple photons. Now look at you!