PDA

View Full Version : tbgl coding challenge



kryton9
08-06-2007, 05:37
This is a fun coding challenge for tbgl.

I wrote this in Delphi 6 using GLScene, all's that I can say is it is an awesome package.
For those that have Delphi, well any version other than turbo as you need to be able install packages.
The free turbo versions at the moment don't allow this.
http://glscene.sourceforge.net/wikka/HomePage

The challenge is to replicate a similar scene in tbgl. The fps doesn't matter, having the controls to generate the textures and to animate are not needed. The main thing is to make a dynamic texture in memory using no outside files, putting them on the faces of a cube and being able to flip through the dynamically created textures for the animation. I also have 4xHQ anti-aliasing turned on in the code.

Hope this demo inspires you tbgl geniuses to come up with similar techniques in tbgl :)

Michael Hartlef
08-06-2007, 09:00
Kent, I don't know anything in TBGL where you can get access to a texture surface or like you want to, attach a texture (in memory) to a model.
So how is it possible?

You seem to know how to do this as you announced this challenge.

kryton9
08-06-2007, 21:39
Mike I couldn't figure it out in tbgl. I thought then maybe I could write a dll to do it, but in looking through all the c++ stuff my brain fried. I did find some examples in c++ but I couldn't convert them. But by far the simplest way was with glscene in delphi. I kept it simple compared to a procedural texture if you noticed. As you saw with some of the noise generation procedural code it does take some time as not meant for interpreted languages. SO I kept it to just simple text output to make it doable in thinBasic and tbgl.

Petr was talking about a new command to allow something like this. I thought this challenge might help motivate him to do it. But if any of you know how to do it with api calls it would be worth seeing the code also!!

Petr Schreiber
10-06-2007, 14:02
Hi kryton,

in current TBGL it is possible just to create bitmap file by script, save it and the load as texture.
I will put the dynamic texture creation on TBGL wish list.


Bye,
Petr

kryton9
10-06-2007, 21:42
Thanks Petr. The reason I am pushing so hard on this is to in the end be able to give programs that are small and can look great. Right now tga and bmp files are just too big and it is tough to make small files and send to everyone.

I also sent you some links and articles via email about putting in compressed tga, png and jpg without using outside libraries. So either having these file formats or being able to make dynamic textures without saving out as bmp or tga first would be great.