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 / How to choose where on an object to texture (Dark shader or not)?

Author
Message
CocaCola
16
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 15th Jan 2011 19:31
Say I wanted a cube for dirt with grass on top. The bottom would be pure dirt, one texture.
The sides would be dirt with some grass hanging down, another texture.
And the top would be pure grass, the last texture.

That's 3 textures.

How do I choose where on an object i'd like to place the textures?
So the top texture can be on the top and not around the entire cube?

Always program as if the person maintaining your program is a psychopath that knows where you live
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Jan 2011 19:56
One solution would be to make the cube out of six plains so it has six limbs. Then use texture limb.

You can't easily texture separate polygons of a limb or object in DBPro - although such models do display correctly if you've made them in another package.
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th Jan 2011 20:15 Edited at: 15th Jan 2011 20:18
I'd use a separate texture which combines all of the required textures, and use a mesh with UV coords designed for it. Of course, that's assuming there are only one or two block types that will have different textures on different faces.

[edit] Actually that's not even necessary, as long as you have a mesh with the right UV coords you should be able to just use multitexturing to achieve what you want.
Kira Vakaan
17
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 15th Jan 2011 20:37
Multitexturing isn't even necessary. Just create an image that has the dirt in one corner, the hanging grass in another, the grass in the third, and leave the fourth unused or find some other use for it. Then make sure that the mesh is UV mapped correctly so that each face of the cube uses the appropriate section of the texture. Otherwise, like GG said, a model that uses multiple textures will display correctly in DBPro, although (to my knowledge) there is no way to do this from within DBPro.

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th Jan 2011 20:55
Quote: "Multitexturing isn't even necessary. Just create an image that has the dirt in one corner, the hanging grass in another, the grass in the third, and leave the fourth unused or find some other use for it."


That's what I said initially, but it's cleaner and more memory-efficient to use multitexturing.
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 16th Jan 2011 06:17
I got a question about this.

If you wanted to edit the UV-coordinates would you use the VertexData commands?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Jan 2011 17:03
Yes.

Login to post a reply

Server time is: 2026-07-18 02:08:56
Your offset time is: 2026-07-18 02:08:56