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 / Combining multiple objects into 1

Author
Message
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 03:49
Another benefit of using the PNGs is the KD AF shader looks much better. (It's still a FPS hog though)
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 03:58
Quote: "I may even go so far as to build my own "object texturing" tool so I can do away with having to use FragMotion. We shall see...."


I actually started this first rather than last.

Did a test with some very simple objects

Make 3 planes, no texture
Combine them to one mesh
save mesh (X File, no textures, now 1 object)

open the X file to read
Parse the file
Add info to assign a separate texture to each plane face.
save modified X file
load object (modified x file)

3 textures! 1 Object. w00t!
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 04:19
Quote: "Did a test with some very simple objects "


Now I have to come up with some kind of scheme as I am creating the giant object, so I know where in the X file what texture to add.

Probably some kind of array to add to as I build the massive object mesh by mesh.

Then I can read my .TXT texture file, index into the array of the X object i create, and add a texture.

That's my current idea anyway.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 08:39 Edited at: 2nd Mar 2018 08:48
The thing I thought would be the hardest, is turning out to be the easiest.

DBP saves the "texture coordinates" when you make mesh from object.

Why they didn't go the next step and save the "MeshMaterialList" when creating the mesh with Make Mesh is a mystery to me.

Anyway, it's quite easy to add manually, er codeingly, to the X file it creates.

So I'm sure my Texture.TXT file and an array to index into will allow me to texture the massive object without using a 3rd party product (FragMotion).

I just tack on the MeshMaterialList in the proper place in the X file and the magic happens.

I love it when a plan comes together....
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 2nd Mar 2018 11:17
Because although x files can be object files, the mesh commands are for x file meshes not objects. Once upon a time you actually could save an x file, but they changed that a long time before the updates ended from what I remember. The only material data needed for a mesh relates to lighting, such as diffuse, uv coords or normals. Have a look at the make memblock from mesh command or vice versa, you can read a description of mesh components, you will note no texture material components are stored in memblock data either. Likewise the vertex data commands reflect this - they do not deal with textures either but also deal with same properties as memblock mesh data. You are aware we have a texture limb command right? If you want to store a material for an object then texture it etc and save as a .dbo object using save object. If that isn't suitable then simply create a text file that details which textures belong to which objects and limbs and have a read back process in DBP that makes sense of that and applies textures correctly. Also if you reference a texture in an object file(have not tested dbo format on this just x file), when you delete the object you will get a one off memory leak per texture. This is because the memory does not get released as there is no texture number to clean up with, think someone said they are in the negative values texture numbers which we cannot reference within DBP. Of course chances are cleanup could have been written in internally, or even access given back to us, but it hasn't if that is the case.

Only time you should need to add a material to an x file like that is if you are dealing with sub meshes which requires more than just generating a material within the x file, you have to change number of faces, number of materials and then change which face references get assigned to which material - in order of faces from beginning to end. If you want to change existing face assignments then you will have to use Ian M's matrix1utils plugin(free) and access memory directly using peek/poke and I think one or two other commands. It's not a route you want to go without covering everything else first, which is a fair bit as direct memory access is unsafe if you don't know what you're doing. That said accessing it this way isn't at all that much different than using memblocks for meshes.

Maybe others here can decipher my post and put it into better wording than I
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 12:03
Do people even read what I write here....

Sometimes I think not.

Look, I am already doing it by reading and then parsing an X file and then adding the mesh texture data using the MeshMaterialList I create and insert.

I don't need plugins.

I don't need Memblocks.

It works FINE.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 2nd Mar 2018 12:26
Wow, do you bother to read and try to understand what people tell you before going on one like that?

1)
Quote: "I don't need plugins."

You have completely misconstrued what is being said. That situation is only IF you are going the sub mesh route. You could do it by writing the file for sure, have done it myself, but the plugin option is faster. It was a suggestion for sub meshes only, which you aren't doing anyway. I merely put it forward as an explanation so that you might grasp the full scope of what is being said.

2)
Quote: "I don't need Memblocks"

Nobody said you did. You asked why DBP doesn't put materials into an x file. I was highlighting evidence showing you that the memblock data of a mesh and vertex data commands both fall in line with data within the x file that DBP produces - which was originally intended to be used as an object file but later switch to accommodate a basic object file, but more purposefully a mesh file. Nothing more. If you don't wish to review that data then that is your call. I did not pop in to argue but to help. As such your approach to advice has forced me into a situation I do not like doing which is to not offer help in future. Thank you for your time sir, I shall not respond further from this point.
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Mar 2018 12:56 Edited at: 2nd Mar 2018 13:00
Oops! Didn't notice the additional posts on a new page.

(In the following I'm referring to your comment after my earlier post. )

Interesting. I wonder why that happens? Were you using a texture atlas when you had the seams? If not then my comments were irrelevant.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 13:43
Quote: "You have completely misconstrued what is being said. That situation is only IF you are going the sub mesh route."


Again, if you would have read what I has written previously...

Quote: "You asked why DBP doesn't put materials into an x file."


No, I wondered why it wasn't in the MESH DATA, that gets written to the X file. Not about the X file data itself that DBP writes when you save mesh.

You're telling me about things I already know, and solved.


Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 14:12
Blog Post: My Background.

I started programming on a VIC 20 in 1980 or so, after I left the U.S. Army.
For several years, I moved on from VIC, to C64 then to Atari 800XL.

I had several programs published in BYTE or Compute! or Computes! Gazette magazines in my first 2 years of programming. Mainly because I used Machine Language well. (Thanks, Butterfield!)

I was self taught at those times.

An acquaintance of a friend heard about my programming and encouraged me to take a few classes at the local community college. So in the CC I learned IBM ASM.

I took all the programming classes they had, and I aced them. COBOL, ASM, BASIC, PASCAL, DELPHI you name it.

I once took 5 programming classes in 1 semester. Some called me crazy. I aced all 5 classes that semester.

After college my first job was for Westinghouse Company fixing COBOL programs. I did that for about a year.

After Westinghouse, I moved from programming job to job as I saw fit.

After 15 years of that, I started taking jobs as Lead Programmer.

After 5 years of that I started taking jobs as Director of Programming (or IT).

35 years later, I still enjoy programming and solving difficult coding problems.

So if anyone has the idea I am some Johnny-Come-Lately, you'd be wrong.

If I shrug off you're advice, it's more because I want to CODE it instead of using someone else's code, not to SLIGHT anyone.

I'm old, and I'm gruff, blunt and to the point. That is not going to change. I will never be Politically Correct.

I also have a low tolerance for stupid.

/Blog
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 14:26 Edited at: 2nd Mar 2018 14:32
Quote: "Interesting. I wonder why that happens? Were you using a texture atlas when you had the seams? If not then my comments were irrelevant.
"


No atlas. It was the JPGs, switching to the PNG version of the same textures fixed the seams.

Opening a JPG and saving it as PNG doen't fix the seams, BTW. Has to be a native PNG.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 2nd Mar 2018 15:03
James H wrote: "As such your approach to advice has forced me into a situation I do not like doing which is to not offer help in future. Thank you for your time sir, I shall not respond further from this point."

I know what you mean. https://forum.thegamecreators.com/thread/221648?page=2#msg2619229
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 15:13
The butt-hurt is strong here...

Man! How do you guys make it through the day being offended by every little thing...I can't even...

If I have an idea of a solution to a question you post in the future, I'm gonna answer it. I really don't care about your butt-hurt feelings.

I won't be butt-hurt if you don't use it. I promise.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 15:16
Mage,

You bowed out after I proved you wrong. You had no comeback to hit me with.

Esp. after I showed you all the info you needed was in the FIRST POST.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 2nd Mar 2018 15:27
Zep wrote: "Mage,

You bowed out after I proved you wrong. You had no comeback to hit me with.

Esp. after I showed you all the info you needed was in the FIRST POST."

You're living a fantasy.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Mar 2018 16:17
I'm sorry to have to agree with Mage and James H. I don't care how much experience you have - and it is less than mine by the way by about 8 years. I am normally prepared to help anyone but some people push our patience just too far. You are in serious danger of becoming one of them sadly.

A number of us have attempted to help you, with some difficulty and in our own time I might add.

I can only suggest that you calm down and try to resolve your programming issues before posting every 5 minutes. When you next feel tempted to post a second or even a third time before someone else has commented on one of your posts I suggest you ask yourself the question "Is it important for me to post right now?". Hopefully that will allow you time to digest everything people have suggested to you - including why it is that you seem to get repeatedly misunderstood. Are you sure everyone here is at fault?
Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 2nd Mar 2018 16:52
Quote: "I'm old, and I'm gruff, blunt and to the point. That is not going to change. I will never be Politically Correct.

I also have a low tolerance for stupid."


Perhaps not, but we do at least expect that the AUP is respected for those posting on these forums.

3.11 We do not tolerate posts made for the purpose of putting down another forum member, group of members, religion, our company, our staff or any of our moderators, past or present.
3.12 We do not tolerate 'trolling', the process of posting inflamatory messages for the sake of starting an argument, or being plain obnoxious.


Keep it clean people.

Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 22:37
Quote: "Perhaps not, but we do at least expect that the AUP is respected for those posting on these forums.
"


I totally agree.

Login to post a reply

Server time is: 2024-04-25 17:58:17
Your offset time is: 2024-04-25 17:58:17