White Textures

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

White Textures

Post by AaronA »

I know I saw this problem here before, but I can't seem to find it now. Only recently I upgraded Irrlicht to the latest version, and my last build worked (displaying heightmap, adding textures, etc), however, now when I compile with the latest version, all the textures are white? I was wondering what causes this and most obvious, how to fix it.

Heres the world creation code, I took out the irrelevant parts, I think it should be easy enough to figure out.

Code: Select all

void WORLD::createWorld(const c8 * heightmap, const c8 * texture, const c8 * detail)
{
    ...
    terrain = device->getTerrain(heightmap); 
    // smgr->addTerrainSceneNode(...);
    terrain->setScale(vector3df(500, 7.0f, 500));
    terrain->setMaterialFlag(EMF_LIGHTING, false);
    terrain->setMaterialTexture(0, device->getTexture(texture));
    terrain->setMaterialTexture(1, device->getTexture(detail));
    terrain->setMaterialType(EMT_DETAIL_MAP);
    terrain->scaleTexture(1.0f, 40.0f);
    terrain->setMaterialFlag(EMF_FOG_ENABLE, true);
    device->getDriver()->setFog(SColor(100, 200, 200, 225), true, 50.0f, 40000.0f, 0.01f, false, false);
    device->getSceneManager()->addSkyDomeSceneNode(device->getTexture("resources/texture/sky.jpg"), 50, 50, 1, 1);
    device->log("World Created\n");
};
a_haouchar
Posts: 97
Joined: Sat Oct 14, 2006 10:51 am
Location: Australia,melbourne

Post by a_haouchar »

yea i heard about this before but i didnt pay atention how they fixed the problem. sorry
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Alright well, I hate to "bump" topics but this is really frustrating now. I completely rewrote my wrapper, only to find out draw2DImage(ITexture *, ...) only draws a white image - when the image is clearly colored (png, 512x512).

The image loads fine acording to the console, and I can see where its positioned, the catch is that its completely white.

Code: Select all

// loading image code
tex = driver->getTexture("resources/texture/tex.png");

Code: Select all

//drawing image code
driver->draw2DImage(tex, position2d<s32>((800/2)-(512/2), (600/2)-(512/2)), rect<s32>(0, 0, 512, 512), 0, SColor(255, 255, 255, 255));
Now, I've noticed that changing the SColor R,G,B values change the image's (or I guess I could call it a filled box <_<) color - which I get, but why isn't it displaying the texture?!?

You'd think this would be a simple mistake, but so far I can't find anything to fix it.
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post by trooper »

Hey :wink:

Are you compiling your code as it originally was, or maybe possible you added or modified it somewhere.

My first point of call would be looking somewhere at the lighting :idea:

Maybe you added something new, or changed the intesity of a light.

Just a guess, but that's where I would start :wink:
You scratch my back, I'll scratch yours.
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

None of the above really :P - it was perfect before, but when I upgraded
to the latest version of Irrlicht (without any changes to code), all textures started comming in white (both terrain and 2d image). Thanks for your input though.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What are your system specs (OS, driver, card)? Also I don't think that lighting is a problem because this is 2DImage.
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Fetching Info...

OS: Micrsoft Windows XP Home Edition (5.1, Build 2600)
Processor: AMD Sempron 3000+, MMX, 3DNow, ~2.0 GHz
Memory: 512MB RAM
Display: VIA/S3G UniChrome IGP, 64MB (Approx)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Which Irrlicht device do you use? Do the binary examples of Irrlicht SDK work for you?
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Code: Select all

// device
device = createDevice(EDT_OPENGL, dimension2d<s32>(x, y), 16, fullscreen, false, false);

// texture creation flag, turned this on and off but doesn't change anything
driver->setTextureCreationFlag(ETCF_ALWAYS_32_BIT, true);
And nope, examples work but no textures (or images), the GUI is only partially visable too.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, probably an init problem. There exists a glxinfo equivalent for windows which prints out all supported extensions and some interesting information of your OpenGL installation. Please send me the output.
Also try DirectX device which might be quite different from what is used or supported.
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

I downloaded GLView (OpenGL Extensions Viewer) and Ill copy the report...
System Info
Windows XP Home Edition

Vendor
S3 Graphics
1.2

Renderer
VIA/S3G UniChrome IGP/MMX/K3D

Extensions
GL_ARB_multitexture
GL_ARB_point_parameters
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_mirrored_repeat
GL_ARB_transpose_matrix
GL_ARB_window_pos
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_packed_pixels
GL_EXT_paletted_texture
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_stencil_wrap
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_lod_bias
GL_EXT_vertex_array
GL_WIN_swap_hint

Core features
v1.1 (100 % - 7/7)
v1.2 (100 % - 8/8 )
v1.3 (55 % - 5/9)
v1.4 (53 % - 8/15)
v1.5 (0 % - 0/3)
v2.0 (0 % - 0/10)
v2.1 (0 % - 0/3)

OpenGL driver version check (Current: 6.14.10.3889, Latest known: 1.2):
Latest version of display drivers found
According the database, you are running the latest display drivers for your video card.

Compiled vertex array support
This feature improves OpenGL performance by using video memory to cache transformed vertices.

No paletted texture support
This may cause performance loss in some older applications.

Multitexture support
This feature accelerates complex rendering such as lightmaps or environment mapping.

Secondary color support
This feature provides an alternate method of coloring specular highlights on polygons.

No S3TC compression support
This may cause performance loss in some applications.

No texture edge clamp support
This feature adds clamping control to edge texel filtering. Some programs may not render textures correctly (black line on borders.)

No vertex program support
This feature enables vertex programming (equivalent to DX8 Vertex Shader.) Some current or future OpenGL programs may require this feature.

No fragment program support
This feature enables per pixel programming (equivalent to DX9 Pixel Shader.) Some current or future OpenGL programs may require this feature.

No OpenGL Shading Language support
This may break compatibility for applications using per pixel shading.

No Frame buffer object support
This may break compatibility for applications using render to texture functions.

Few texture units found
This may slow down some applications using fragment programs or extensive texture mapping.

Extension verification:
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexImage1DARB
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexImage2DARB
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexImage3DARB
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexSubImage1DARB
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexSubImage2DARB
GL_ARB_texture_compression was not found, but has the entry point glCompressedTexSubImage3DARB
GL_ARB_texture_compression was not found, but has the entry point glGetCompressedTexImageARB
GL_EXT_color_subtable was not found, but has the entry point glColorSubTableEXT
GL_ARB_texture_compression was not found, but is available in driver version 1.2
GL_EXT_texture_compression_s3tc was not found, but is available in driver version 1.2
GL_S3_s3tc was not found, but is available in driver version 1.2
And DirectX doesn't work (I'm under the impression its because gnu-gcc/codeblocks; gcc library says "DIRECT3D[version] Not Compiled in this Library... etc, etc - and don't have VS installed at the moment).
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Since I can't find a solution I'm just going to downgrade back to 1.1 since I'd hate to scratch this wrapper now that I got FMOD's undocumented C API to wrap with it. Its ashame really, I was looking forward to the new improvements.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The examples are compiled with MSVC so you can test DirectX using the examples. And did you check for driver updates?
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Yea, the DirectX version in the examples don't work either, and I've got the latest driver updates.
AaronA
Posts: 55
Joined: Tue Sep 12, 2006 1:31 am

Post by AaronA »

Argh, one last thing before I throw Irrlicht out the window, now that I've downgraded back to 1.1, it doesn't want to create the device, before device creation the console says...
Multittexturing active
Then its crashed with a Windows Error Report. What I'd really like to know out of all this is why its saying, 'Multittexturing active', why is it crashing right before (or at) device creation, and why's multitexturing spelt wrong?
Post Reply