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 / $50 and truespace 4.3 whoever gets vertex colors working in DBP best

Author
Message
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 27th Sep 2003 04:22
I'm offering $50 (USD) and TS4.3 (including large manual) to the person who finds the best solution for geting vertex colors from 3ds Max 5.0 into DBP. Solutions will be judged on several factors:

1- if it works
2- how fast is it
3- ease of use
4- file size (meaning how much it enlarges projects)


Keep in mind that you can write plugins or new exportes for max and plugins for DBP. You can also use multiple files (IE, model and vertex color data file)

DBP not only doesn't load models with vertex colors but it also scrambles meshes that do have them. I reccomend that your solution use 2 files (model with no vertex color data and vertex color data)

Also, it must must import DX8.1 X files for the geometry.

The deadline for submissions is October 8th. All submissions should be sent to [email protected]. Payment will be via PayPal. If you don't live in the US I will ship truespace with the cheapest shipping availible (within reason).

By submitting you give us permission to use your code and your system in any projects we choose with or with or without credit.

questions? email: [email protected]

Goto http://www.shellshockede.com
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 27th Sep 2003 05:07
Not a bad deal, but very hard to do.


"Computers are useless they can only give you answers."
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 27th Sep 2003 06:05
I have uploaded 2 test ojects to my server. these are 2 identical cubes except one has vertex colors and the other doesn't.

http://www.shellshockede.com/vertexcubes.zip

Goto http://www.shellshockede.com
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 27th Sep 2003 15:47 Edited at: 27th Sep 2003 16:05
I did a quick test, I read the vertex color information from the X file happily and load it into an array.

The bit that confuses me though is that the X file defines 8 verticies, which, given that the shape is a cube, makes perfect sense. However, when I create a memblock from the object (tested before and after converting the FVF to 338), there are 36 vertices! - where do they come from. And which vertex in the DX file matches which ones in the memblock?

[EDIT] I checked the object in Blitz to see what it is supposed to look like, I can get one face semi-correct, but not the others. I really need to understand where these extra verticies come from. Unless there is an easy answer it might require writing a complete X file loader in DB code

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Sep 2003 15:47
you want the simplest way...
select the vertex you want - goto the end of the edit menu and select the colour you want it as - export using Microsofts DirectX Exporter

the only problem with th exporter is it MUST be compiled for the version of CStudio your using.
a simpler way of achieve this is also to select your main material as a Vertex Colour, set the lights in the scene to what your want the colours and then use Vertex Color Assign in the extras menu to calculate the colour normals.

hardly a hard or brain taxing task, the only thing that threw everyone was the fact that before update 5 ... Vertex Colours DID NOT WORK in DBP.
however they do now.

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 27th Sep 2003 16:01 Edited at: 27th Sep 2003 16:03
Quote: "however they do now."


No they don't. Load Froggermon's model in and you'll see it looks crazy with verticies everywhere, and no colors loaded. Load the object in Blitz and you can see what it should look like.

I know of other problems with the loader as well, in the past I have had perfectly legit. X files which didn't load (I know it was an error because the X file is quite flexible - moving the data around made it work).

Interestingly, Blitz reports 8 verticies in the model rather than 36 as well.

mimesis
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 27th Sep 2003 16:54
Rob K,

the cube has 6 faces
6 faces equal to 12 triangles
12 triangles equals to 36 vertices

Hence no vertex sharing.

Me, You, DBP and everything else, were made in the same place. The Stars!
I wonder what kind of matter DBP bugs are made of ... antimatter ??
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 27th Sep 2003 20:42
Yes, I can see that, but I presumed that verticies would be created as defined in the X file rather than seperately. It strikes me as rather inefficient to use 36 verticies instead of 8. Is this the case?

AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 27th Sep 2003 21:52 Edited at: 28th Sep 2003 22:28
they were welded in max if thats your question

Goto http://www.shellshockede.com
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 28th Sep 2003 17:31
As 8 verticies are defined in the X file, I presumed that DBP would create 8 and share them, apparently not.

Grrr... this means that the only way to do it would be to create the object from scratch by reading and interpreting the X file.

AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 28th Sep 2003 22:55
a textured sphere was requested on the LLRGT boards.
the file is http://www.shellshockede.com/spherevertexcolors.zip
some helpfull information:
the model is 840 polys and 422 vertacies. The texture is a 128x128 PNG.

Goto http://www.shellshockede.com
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 28th Sep 2003 23:00
RobK I had an idea. I'll bet DBP unwelds those vertecies so that no smoothing is applied. If you try the sphere Im willing to bet that the vertex count will be the same as the one I listed.

Just a thought.

Goto http://www.shellshockede.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2003 11:13
36 vertices is right dudes, you gotta learn memblocks properly .

A cube, which has 8 corners would be defined as 8 vertices, but only because it has no texturing, put a texture on that puppy and it'll jump up. Basically, all the verts are welded, but when you load the .X file into DB as a memblock, your mesh is split into individual polygons, meaning 6 faces x 2 polys, that's 12 individual polygons. But - to make those 12 polygons, you need 3 vertices each, giving the 36 verts.

I think the best bet would be to make an editor, in DBPro that loads the .X file then lets you colour the verts, you could even make it check a secondary texture map to get the colour. Once you have your vert colour how you like, you save the finished mesh as a memblock and there you have it, vert colours and a semi-protected format to boot.

I could stick this onto what I have on VANmesh and email it if you like. It's not ideal, but I think replacement texture maps and easy to edit vert colours is a lot easier than file importers etc. I'm not really bothered about TS or the $50 though, but I could'nt let you have the source code - just an example for loading the memblock mesh into DBPro.


Van-B

My cats breath smells of cat food.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2003 12:25
Thinking about it while eating my breakfast, it could all be done with a function. Like you load your object, then pass the object number and a vertice texture map image to a function that replaces the object with a vertice coloured version. Making the vertice maps could'nt be simpler, draw over the top of your texture map and the verts will take the colour from their UV positions. You could make the vertice maps lower res too, and they'd compact real small because you'd get away with using .jpgs.

Sounds like a plan to me, plus it means you could easily store more than 1 vertice map - different lighting conditions could have differnet vertice colours. I'll make a function to make it into a mesh too, in case you wanted to store the object in memory. I'll most likely use this too.


Van-B

My cats breath smells of cat food.
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 29th Sep 2003 13:15
sounds cool Van-B... Keep in mind that im doing some complicated lightmapping in max that utilizes vertex colors. People entrys will do much better if it can load pre-existing vertex color data into DBP. However if your not interested in the competition than I gess it doesnt really matter.

Goto http://www.shellshockede.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2003 13:50
D'oh! - there is another way...

I think Patch3.1 was the start of vertice colours not working in DBPro, so you could just load a mesh then save it as a memblock in standard unpatched DBPro, and then loading the memblock in a patched version for conversion to a mesh.

So crazy it might just work!. The problem is that memblocks only use 32bytes/poly when converting from a mesh in recent patches, but you can specify a 36byte format when creating memblocks again - so you should be able to do something. Unless you could simplify the vert colour format, maybe export it as an ascii file or something (never been clued up with Max) - if you have access to the model data in an understandable form you could import the vertice colour data then use the same memblock method.


Van-B

My cats breath smells of cat food.
AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 29th Sep 2003 14:02
you sure about them working in pre-3.1? thats sounds like a pretty good method

Goto http://www.shellshockede.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2003 14:09
Yep, I read in a topic that they changed the format when they added the internal DBO format that we know so little about - so an unpatched Pro should support them .


Van-B

My cats breath smells of cat food.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Sep 2003 16:38
Alternatively, maybe if you unweild the verts, as Froggermon has suggested, the DX file will contain information for all those verts - which will match the FVF 338 memblock format. This assumes that the converter doesn't do anything with the verts other than put them into an X file.

I'll try something with this later.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Sep 2003 17:06
Hmmm, reckon the .X format will be a tad more complex than the memblock one - and there's another problem... Texturing . You could only use 1 texture if you use memblocks - not a big problem if your making terrain models because you can use a matrix style tile set, but for an interrior, it's pretty bad.


Van-B

My cats breath smells of cat food.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Sep 2003 21:07
Quote: "You could only use 1 texture if you use memblocks "


I would just create a seperate limb for each texture. The X format itself is pretty simple.

AlecM
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 30th Sep 2003 13:36
its funny how things work out. Mike sent me an email today saying the vertex colors would be in a patch that was soon to come. Im still gonna give somebody the $50 plus truespace because fair is fair. So if anyone still wants to do it the money is still on the table.

[P4 2.8C @ 3.03 with an 866mhz FSB:: MSI Neo-2LS running PAT:: 1gb Mushkin PC-3500 DDR High Perf level 2@ 2,2,2 :: ATI Radeon9800ProAIW :: 120Gb SeagateBarracuda 7,200RPM SATA HD :: Antec Plus1080AMG]

Login to post a reply

Server time is: 2026-07-25 07:00:57
Your offset time is: 2026-07-25 07:00:57