Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Textures turn into black

Author
Message
Ankhranum
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 11th Dec 2010 20:41
Yea, I was busy with the tutorial about textures, but when I load a texture for an object like a sphere or a cube it is totally black!
Does someone knows how to fix it?
In attachment is a screenshot.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 11th Dec 2010 23:15
There are 2 things that might cause this:

- Lighting: Try using set object light obj, 0 and see if the texture shows up after that. If it does, then it might be because the normals are inverted, or because they don't exist (all 0's).
Anyway, in this case, your problem is the lighting.

- Loading the image: Some image formats don't give an error when the file doesn't exist. Instead, DBP creates a giant black transparent image (transparency doesn't affect an object unless you say so with set object transparency).
In this case, the problem is that you're tying to load an image that doesn't exist. Possibly because you've put them in the wrong folder.

Cheers!
Sven B

Ankhranum
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 12th Dec 2010 00:30
I did find it somehow. When I looked better to my code I saw i also had to define the directory in the filename. (Such as "media\tex.png").
Still thanks for your help.

This topic can be closed.
Oh, bytheway. Did I placed it in a wrong board? Or is this indeed the correct one?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Dec 2010 01:06
You're in the right place.

Login to post a reply

Server time is: 2026-07-21 04:20:28
Your offset time is: 2026-07-21 04:20:28