Game Development Community

Downloading and changing a texture on the fly

by J Helleman · in Torque 3D Beginner · 03/10/2011 (5:56 am) · 11 replies

Hi,

I am new here and just started using torque 3D. I have C++ and C# experience. I can probably write code for the engine to load a bitmap that I downloaded through the Gbitmap and TCPObject. But I wonder how, when I downloaded this image and converted it, I could apply it to an existing object in a game? I just don't want to go through to much hassle to test this possibility for my work, it's still just r&d :)

Kind regards,
Jan

#1
03/11/2011 (5:00 am)
No one that knows anything on this subject? Even some help with changing textures would be helpfull since I prob can manage to create them in C++ through some coding. I just need to find a proper way to alter textures on the fly instead of preloaded material changes
#2
03/11/2011 (5:19 am)
How do you have the source code for the engine if you don't have a license?
#3
03/11/2011 (5:21 am)
A friend of mine has it and there I can look into it and work on it. I think it's an older version as well, from 2009. If I can manage to do what I need it to do it is well worth the 99$ that it's for sale on right now. Does that answer your question?
#4
03/11/2011 (5:48 am)
@Jan: It does. But since the license belongs to your friend, then either he should post in order to get the support, or you should buy a license in order to get the support, since the license is non-transferable, and only applies to the person who bought it.
#5
03/11/2011 (5:50 am)
That might be the solution for me if I would have known someone could help me on the matter. I have to make a proof of concept within 5 weeks and I cannot waste 80 euro's on the matter without knowing it is possible and doable...
#6
03/11/2011 (6:25 am)
With source code, just about anything is possible. It's not an API though, so you won't be plugging functions together as such, but actually creating and integrating the feature into a game engine, and you may run into issues that neither of us know about regarding what you want to do. How easy will it be to implement? I don't know. Maybe someone else coming across this will be able to give a better answer for you.
#7
03/11/2011 (6:28 am)
Ok I just bought the thing, will my chances of getting help be greater?
#8
03/11/2011 (7:13 am)
Should be...

I think where you want to look is in the GFX classes, specifically where the texture stuff is. That's where I would start, at any rate. Also, most code-centered discussion occurs in the private forums, and you can do a Google search on them (using "site:garagegames.com" followed by search terms) for topics like "GBitmap", "TCPObject", and other terms related to your needs, in case people have worked on similar functionality.

There is also the support area, but I would recommend grabbing the offline docs from there and using the forums.
#9
03/11/2011 (7:17 am)
Did a search ("site:garagegames.com gbitmap") to be curious and found two links for stuff to get you started:

Older, related to TGE but probably still helpful.

From the private forums.

Hope that gets you on the right track.
#10
03/11/2011 (8:41 am)
For quick prototyping you could simply modify a material at runtime and reapply, but that would affect all objects of that type.

There was a Resource by Phillip O'Shea that allowed one to download and display images from the internet, but think it was for GUI elements and not objects though.
#11
03/11/2011 (8:49 am)
Wauw thanks for your help so far guys really appreciate it! It doesn't matter if it's quick and dirty (like yours, michael hall) as long as I can prototype and make it happen, in future I can always make it nicer :) I think I'd probably need to make a function that can alter the texture inside a material, for example with a GBitmap that is downloaded from the internet... I think that is what you mean, michael...