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 Discussion / Texturing Questions

Author
Message
sirrho
17
Years of Service
User Offline
Joined: 12th Jan 2008
Location:
Posted: 12th Jan 2008 17:35
Hi everyone. I've just started with this dark basic thing, and I have a few questions. I've already gone through a bunch of tutorials and I have a pretty good feel for the language, but I'm having trouble finding information on texturing.

For one, I've made a model in Lightwave 3D and exported it as a 3ds object. The model contains texture information, and the texture is in the same folder as the model, but when I open it in darkBasic it only shows orange (the texture is of a brick wall). I tried applying the texture through darkBASIC itself instead of relying on the 3ds info, but the same thing is happening. So I thought to myself "could it be resolution?", I changed the image to the same res as the game, no dice.

Can anyone give me any help? (code below)
Also, how do I apply bump maps in dB?

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Jan 2008 22:12
Hello,

From your description of the problem I suspect that the texture coordinates are not set up properly in your 3ds file. When you say the file displays texture information, what exactly do you mean? There are materail definitions which hold colors and even the file names of images that are used to texture objects - but this differs from the UV texture coordinates which tell how to stretch the image over the model. If these values are not correct, you are likely to only get the first pixel of the .bmp file stretched across the entire model (but this could also be a material definition of the diffuse color). I suspect it's the UV coordinates either being not set up correctly or not being exported at all as in your snippet your are loading the bitmap separately and texturing the model inside DB. Try to find out what options you have for UV texture coordinate export in lightwave.

Enjoy your day.
sirrho
17
Years of Service
User Offline
Joined: 12th Jan 2008
Location:
Posted: 12th Jan 2008 23:43
Thank you Latch, you were right. I found a different way to export the models with the texturing, and it works fine.

Could you tell me how to apply bump maps in darkBASIC?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Jan 2008 01:20
You could fake it by having created a texture that looks like bump mapping; but there's no real convention for bump mapping in DBC. If you texture an object with a good looking texture, it can appear to be bump mapped, but the shadows and highlights won't change with the object angle. With a bit of doing you could probably manage it by calculating normals against the light angle and draw a texture that shows the light response to the shadowing and highlights of the pits and bumps you would calculate. This would most likely be a bit slow for real time bump mapping if you wanted to use it in a game. There may be a DLL that could be used; or if you know anything about creating a DLL, you could create one yourself.

Sometimes people refer to a height map as a bump map if that's what you mean. A height map for terrain can be done using a DBC matrix, but you have to program it yourself or find one of the examples on these forums.

Enjoy your day.

Login to post a reply

Server time is: 2025-06-02 10:06:12
Your offset time is: 2025-06-02 10:06:12