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 / Adding multiple textures to billboard sprite objects

Author
Message
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 3rd Jan 2015 22:37
Hey everybody,

I'm working on a retro FPS/RPG game in the graphical style of Wolfenstein and Doom.

I've been trying and searching but I cannot seem to get it working. I wish to add several layers of PNG textures (with transparency) to a single faced object that I want to use for billboard sprites (like the characters in Wolfenstein, Doom and Duke3D).

The idea is to create naked bodies and clothing layers, so I could change the clothing and weapons easily, without have a zillion pre-made textures.

Loading an object, adding the skin/texture is no problem. I do it without mipmapping to get that great pixel-art come through, but I would really like to add multiple "layers" so to say.

Any help is much appreciated. Thanks!

Regards Sph!nx
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 3rd Jan 2015 23:09
Am I correct in assuming that what you're looking for is essentially a pixel shader that will blend the textures ("layers") together?

Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 3rd Jan 2015 23:19 Edited at: 3rd Jan 2015 23:59
I think so, yeah. Keeping the transparency in the PNG files is important as well. Any idea how I could do that?


Edit:
Fixed Grammar

Regards Sph!nx
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Jan 2015 17:02 Edited at: 4th Jan 2015 17:40
I'm a bit further with solving my question...

I understand I can use blendmapping. I learned that it only applies when adding additional textures, not the first one.

Here is my code:


The problem I now have is that the second texture is mipmapped, thus smoothing the pixels (which I do not want). I tried many different blendmodes but they all smooth it.

Anyone has an idea?

Regards Sph!nx
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Jan 2015 18:17
Set object texture might do it.



Powered by Free Banners
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Jan 2015 18:40
Thanks mr. Gandalf,

I've added this line to my code my previous post...

...after I've set the second texture blending (which worked fine) but still, only the first texture had no mipmapping. Even after this command the second (blended) image still has mipmapping.

Regards Sph!nx
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 4th Jan 2015 21:48 Edited at: 4th Jan 2015 21:49
SET OBJECT FILTER Object Number, Stage Number, 0 < No mipmapping

"Get in the Van!" - Van B
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Jan 2015 22:05
Quote: "Even after this command the second (blended) image still has mipmapping."


Well it would wouldn't it. You've only turned off mipmapping for the first stage, stage 0. If you want to turn it off for the next stage then you probably need to include that stage number, e.g. for stage 1 use



You could also try Sasuke's suggestion but I guess the same applies there.



Powered by Free Banners
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Jan 2015 22:19
Thanks Sasuke and Gandalf!

Tried both methods and Sasuke's suggestion worked like a charm! Problem solved!

Thanks again!

Regards Sph!nx

Login to post a reply

Server time is: 2026-07-05 13:16:21
Your offset time is: 2026-07-05 13:16:21