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 / Materials as limbs

Author
Message
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 28th Apr 2010 02:24 Edited at: 28th Apr 2010 02:35
Alright, I give up... - I just spent an hour or so looking everywhere and asking everyone who might know if they knew a method to do what these pictures illustrate:

Here is a picture of 1 object with 1 limb and 3 materials. All the polygons are part of the same limb but have different materials.


Here is a picture of 1 object with 3 limbs and 3 materials. Each limb has its own material. (The rotation is to show they are now separate and is not a desired effect.)

All I need is a method that can get from the first picture, to the second picture automatically. - Just a quick in and out with a .X importer/exporter or something, or a function in a modeller.

The closest thing I have is the function in Deled 2.43 to select polygons by material:

But this just isn't good enough if I have like 300 different textures and 20,000 polygons. There isn't even a key shortcut for the function so you can imagine just how long it takes to split a map into limbs this way.

---

For those of you who wonder why I need to be able to do this, ask yourself how you would add a shader to a model if it had 2 textures?
Would you just apply the shader to the model and disregard that you have 2 textures underneath it?
What about a map for a level, if could have 50 textures for various vents, gratings, floors, ceilings, doors, windows.
You might want to shader the gratings and vents with bump mapping, the floors, ceilings and doors with a shiny-shader and the windows with a refraction shader.
How would you do this with 1 model?

Well the only way I see to be able to do it is to split each type of material into a limb and shade those limbs according to the texture.
All the windows will have 1 texture, all the vents and grates will have another, etc. and each polygon with a texture will be added to a limb along with all the other polygons of the same texture, so you have 1 nice, manageable limb with only 1 texture. This limb can then have an individual shader applied to it.

This was done in Soup and took a good half an hour to split a map into these limbs in order to get the correct height/normal maps for the correct textures on the map. - There is also only 1 map file due to this method.

Someone, surely, among the thousands of people who use this forum must have a solution?

Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 28th Apr 2010 02:45
Try Ultimate Unwrap. You can assign materials to individual faces, and create groups from those faces. When you export in .x, it gives you an option to export groups as meshes, which would be limbs. Best import/export of anything I've tried, and tons of other plugins available.
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 28th Apr 2010 02:56
Heh, I thought you had it then Visigoth but I'm afraid $50 or however much they want is a little too far out of my budget, especially after already paying for just about every other piece of software under the sun to do these kind of things with "ease". xD

Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 28th Apr 2010 03:37 Edited at: 28th Apr 2010 04:03
I own the Lite version, and I own the Pro version. I don't use the Lite version anymore. If you want, I could give you the unlock for the Lite version. It still does the exports. The Pro version just has more bells and whistles.

edit:
just shoot me an email, or reply here, and I'll email you the details.

edit:
doh. never mind. I tried to reinstall the Lite, and the code is deactivated, because I did an upgrade, I guess.
Sorry, I tried. But the Lite version is worth it, it will do what you suggest, and then some.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Apr 2010 11:55
I think, that if you export as a .3DS, then use DBConv, the 3DS to X converter, it will set each material as it's own limb automatically, it has to otherwise the model won't work in DBPro.

If you don't have that DBConv to try, then I could upload it.


Health, Ammo, and bacon and eggs!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Apr 2010 13:50 Edited at: 28th Apr 2010 13:53
Quote: "For those of you who wonder why I need to be able to do this, ask yourself how you would add a shader to a model if it had 2 textures?"


That`s not so hard for a level to have three limbs... floor ,walls and ceiling.I think that you will have to use three shaders and not just one...you are trying to get three different effects with just one shader ....I am not a specialist in shaders, but I'm afraid you'll have to use three shaders.

cheers.

I'm not a grumpy grandpa
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 28th Apr 2010 15:24 Edited at: 28th Apr 2010 17:57
@ Visigoth
xD Fail... but never mind, Van B's solution sounds more promising

@ Van B
I don't have DBConv (I haven't even heard of it) Is this the missing link between boringly-lit maps and awesomeness? !

I can export to .3DS so if you can upload DBConv and it works, that'd great (And you'll have stopped Soharix slumping back to the dark ages of game development )

EDIT:
Ok, I thought I could export to .3DS but apparently I can't...

I got DBConv from another thread, so now all I need is a .X to .3DS converter so I can use DBConv to go back. xD

EDIT2:
Ok scrap that, it didn't work...

I got Blender to import a .X and export as .3DS (which Deled can import anyway) and it just randomly decided to not texture anything, completely screw up the material-limb hierarchy and delete a few polygons along the way... xD (Definitely need an alternative method here)

@ chafari
xD You missed my point:
I've already done this, I can apply different shaders, or the same shader to multiple limbs in an object, I just need different textures to have different limbs so I can effectively apply different shaders to different textures. - As seen in Soup (download it and open SoupworldG.x in Data\Object data to see what I mean) it uses 1 limb for every new texture. Then in DBP (the application) I have code to distinguish limbs of certain textures from others and apply shaders accordingly.

---

EDIT3:
Ok clearly it's beyond the wit of man to perform such a file format conversion so if someone wants to tell me how to read .X files and make polygons that I can attach to limbs I'll just code it myself.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Apr 2010 19:55
Quote: "xD You missed my point:"

I missed you !! ....

I'm not a grumpy grandpa
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 29th Apr 2010 00:04 Edited at: 29th Apr 2010 00:05
Actually you can apply the same shader to each limb that has a different texture. I did that for my game. The floor and walls are seperate limbs.]



If it hasn't exploded yet, I haven't touched it.
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 29th Apr 2010 00:23
xD

I know.....

That's not what I'm after.

I can already:
Apply shaders to objects
Apply shaders to limbs
Apply different shaders to 1 object via different shaders to different limbs

The only thing I can't do is separate things like walls and floors automatically.

C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 29th Apr 2010 01:39 Edited at: 29th Apr 2010 01:44
!!!!!!!

Finally did it!

Thanks to blobby 101's suggestion to try Lithunwrap 1.3 and Van B's idea.

A mixture of the 2 worked wonders.

For anyone needing this technique in the future to avoid you having to go through the nause of asking this stupidly complicated question, here is the solution laid out:
1. Map made in Deled, merge all limbs (to ensure it doesn't go over the maximum group-count in Lithunwrap) and export to .X
2. Import that map into Lithunwrap 1.3 (File\Model\Open)
3. Export that same map without any manipulation to .3DS (File\Model\Save)
4. Use DBConv.exe (which can be found in various threads around the forums) to convert that .3DS to a .X.

VoilĂ , you now have a map with a limb/mesh per material/texture. !

Thanks guys, it's only taken me 3 threads on 2 different forums and enough hair-pulling out to make a wig. xD

Login to post a reply

Server time is: 2026-07-26 04:28:12
Your offset time is: 2026-07-26 04:28:12