|
4 registered members (TipmyPip, Grant, vince, 1 invisible),
4,341
guests, and 16
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: Excessus]
#119565
04/03/07 14:47
04/03/07 14:47
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
Quote:
Have you tried to copy/paste my code in lite-c? I don't know what the problem could be as I've not used lite-c extensively yet. My code doesn't use any C++ specific constructs, so you should be able to use it in lite-c aswell (maybe remove the type conversion macros).
yes, i tried your version. my version and your version seem to give me the same wrong results in lite-c.
how does your VERTEX struct look like?
Quote:
Do you need this for your newton plugin, or for this plugin?
it's needed for both. printing out the mesh will be helpful for debugging and almost the same code will be usable for feeding the geometry to newton for collision detection.
(and i have another idea where this would come in handy. for machinima projects i always wanted to create a plugin which allows you to record gameplay and then render a high quality version from it using a renderer like yafray or gelato. )
Quote:
Are you planning on doing this plugin, once you get the hang of d3d? I've given the algorithm some thought and I must admit it hurts my brain.
i would do it if i got this d3d stuff working but i am not sure when and if this will happen. maybe i should better try to use a c++ compiler but i can't download the huge directx sdk with my crappy internet connection.
the algorithm isn't tricky. basically you just have to iterate through all triangles and put each vertex (with its position, normal, uv1, uv2 data) of a triangle into a python dictionary (called hash table or map in other languages i think?). to build the index list you can lookup the vertices in the dictionary then.
...
i think simply loading the second uv-set from an exported med txt file won't work since with that format you won't know which uvs and which vertices belong together for light maps.
so like i already said i would do a complete mesh loader which replaces the mesh of an entity. another problem came to my mind now though. such a mesh loader would also have to care about loading textures which makes it more complicated. or the entity which gets the mesh replaced would already need to have the correct textures applied but this would be a kind of ugly solution since there always would be the need for two versions of the model (mdl7 + custom format) then.
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: ventilator]
#119570
04/05/07 03:08
04/05/07 03:08
|
Joined: Aug 2001
Posts: 2,320 Alberta, Canada
William
Expert
|
Expert
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
|
How is this gonna work for a 80-100 model scene? Is the user going to have to export 2 models for every model in the scene? Afterwards, would the code just be able to red the uvcoords thru a script? I think the workflow would be very hampered if you have to go into MED to get the uvcoordinates for every model... maybe have the models used for retrieving uv coords have a special tag in front of them, like "uv_chair.mdl". When the script runs it takes "chair.mdl" for the base, grabs the extra coords from a model with "uv_" in front of the original model name, then applies it. If the "uv_" model doesn't exist, then it just uses the original uv parameters for both texture 1 and 2. I ask this question because workflow is one of the most important aspects of developing a game. The typical workflow I use for a level goes something like this: Create scene in Max. Export Scenes models into a folder with Max2MDL. Export models positions via Max2GS. Build in WED. If one were to use a second uv set. Mabye like this: Create scene in Max. Bake lighting into a separate Map Channel. Export Scenes models into a folder with Max2MDL using map channel #1. Export Scenes models into a folder meant to hold uv models only, only this time using map channel #2. Export models positions via Max2GS. Build in WED. Let the script do the rest of the work, without having to use MED. I'm not sure how mabyenew would go about this, i'm interested if theres anyway to speed up the changing everything to map channel #2 in max part? 
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: William]
#119571
04/05/07 04:06
04/05/07 04:06
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
using med uv-export like maybenew suggested wouldn't work anyway. if everything works out i will create a c-script+python tool which reads the two model files and generates the txt file the plugin will require. so you could script your own batch job in any way you want. before i continue i will probably have to wait for jcl though since i have some questions... does anyone know if the directx9 sdk from summer 2004 will still be useable?  i will have to switch from lite-c to c/c++ sooner or later.
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: ventilator]
#119572
04/06/07 14:03
04/06/07 14:03
|
Joined: Jan 2004
Posts: 2,013 The Netherlands
Excessus
Expert
|
Expert
Joined: Jan 2004
Posts: 2,013
The Netherlands
|
Quote:
does anyone know if the directx9 sdk from summer 2004 will still be useable? i will have to switch from lite-c to c/c++ sooner or later.
I just checked, and it contains DirectX9.0c, so I guess it should work. Do you have a copy of it lying around? If you have to download it anyway, why not download the latest SDK (february 2007)?
BTW, wouldn't it be easyer to use an already existing format that supports 2 UV maps to load the models from? So instead of exporting to mdl, you'd just export to something else. That way the workflow would be optimal. Does .x allow multiple UVs? What about .fbx?
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: Excessus]
#119573
04/06/07 15:05
04/06/07 15:05
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
the summer 2004 sdk worked! i have a monthly bandwidth limit and downloading 500mb packages can be kind of problematic.  i think i am almost done with the plugin part. i just have to know how to replace the mesh of an entity (any idea?) and some other small details i have to ask jcl next week. supporting other formats would be more work (but maybe this can be done later). i think x supports two uv-sets and it could be loaded automatically but in my experience most x exporters are really crappy and i think this would lead to more trouble than it is worth. my plugin will contain 2 simple functions: export_mesh this exports the mesh of an entity to a text file. the file directly contains the buffer contents direct3d needs. import_mesh this imports such a text file, creates a new mesh from it and assigns it to an entity. (this functions isn't fully completed yet.) the workflow will be like that: there will be a tool which uses the plugin. it will export both model versions (model1/uv-set1, model2/uv-set2). then a python script will be started which merges the two files into one file which contains a mesh with both uv-sets. in your game you just will have to use ent_create() with the normal model and then import_mesh() to load the mesh with both uv-sets. i could also extend my blender exporter to export this format directly.
|
|
|
Re: [Plugin] Import von 2. UVMap / Import of 2nd U
[Re: ventilator]
#119574
04/06/07 22:25
04/06/07 22:25
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
 +20 = 260 € Go, vent, go...!
no science involved
|
|
|
|