Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 781 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to get 16it floats out of a bmap... pixel_for_vec dont work! #384489
10/03/11 22:41
10/03/11 22:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Hiya all.

Im trying to use a 16bit DDS image to store heightmaps.
Creating the image, and loading it as a BMAP is fine.

BUT, I cant get individual pixel data out of it using pixel_for_bmap and pixel_for_vec
because (according to manual) pixel_for_vec can only manage to handle
"...the pixel format: 88, 565, 888, 1555, 4444, or 8888". And it doesnt even complain
when I try to force it to use pixel format "16""12"...

Any ideas on how I can extract this info (on a pixel by pixel basis) anyone?

Thanks guys...


Last edited by EvilSOB; 10/03/11 23:12. Reason: fixed typo

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: EvilSOB] #384490
10/03/11 22:45
10/03/11 22:45
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: Superku] #384492
10/03/11 23:14
10/03/11 23:14
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Sorry, but Im already doing that to get the pixel format of the image.

PS: Ive fixed a TYPO in my main post regarding the format number...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: EvilSOB] #384494
10/03/11 23:18
10/03/11 23:18
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Assuming, that your dds contains texture data compressed with an algorithm, you´ve got hardware support for, the problem is, that the compressed data is never really decompressed. And to actually give you access o the pixels it would have to do this. So the best choice for you is probably just some tga file with losless compression, which is then anyway decompressed on loading.

Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: Slin] #384496
10/04/11 00:11
10/04/11 00:11
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No can do. I NEED a 16bit value per pixel.
And I cant get TGA to go 16bit. But Im no 'photoshop guru'...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: EvilSOB] #384577
10/05/11 01:01
10/05/11 01:01
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
256*b+g?

Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: Joey] #384579
10/05/11 02:36
10/05/11 02:36
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Originally Posted By: pixel_for_bmap
Only normal 16, 24, or 32 bit bmaps can be read from. Accessing compressed DDS bmaps, or bmaps used as render target will also cause a crash error.

Your 12 bit DDS bmap is not normal grin
[EDIT]
I assume that you must read the pixel first with pixel_for_bmap before using pixel_for_vec

Last edited by bart_the_13th; 10/05/11 02:37.
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: bart_the_13th] #384595
10/05/11 09:05
10/05/11 09:05
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Joey: No good dude. I need the actual 16bit data as saved by 'photoshop'.

Bart: Re-read my top post regarding number of bits. I am actually working
with a 16bit float DDS file. The "12" in my top post is the "pixel type number"
that gamestudio returns from bmap_lock. Read the manual under bmap_lock and
check the type 12 entry. Thats me...

And yes I am using pixel_for_bmap first. I also tried looking at the raw
'pixel' data as stored in the var returned by pixel_for_bmp, BEFORE using it in
pixel_to_vec but could make no sense of it or use for it.

I wish I knew how to get inside GS's pixel format, because I suspect the 16bit
data IS being retrieved by pixel_for_bmap, its just that pixel_to_vect doesnt
know how to process it...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: EvilSOB] #384602
10/05/11 10:35
10/05/11 10:35
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Do you use any compression? What pixel format are you saving with? It is a dds file? Is it loaded correctly? Can you display it in a panel or something? What exactly is supposed to be in the texture?

I think that gamestudio uses some directx function to load dds files, which should support many different formats, but the bmap functions only support a small number of formats, so if your texture is really uncompressed, it could be that you can´t really use gamestudios functions to get the pixels, but it should then at least be possible to directly access the texture data.

Re: How to get 16it floats out of a bmap... pixel_for_vec dont work! [Re: Slin] #384616
10/05/11 12:22
10/05/11 12:22
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Its a 16bit float (one color channel) DDS, so I assume it to be compressed. All DDS files are I BELIEVE (noob to DDS).
I only went DDS cause it was one of the few formats that could carry a single 16bit 'color'.

GS DOES load the image, as I am able to display the image with DEBUG_BMAP.
It is a strange washed-out cyan color, but it is recognisably the image in question.

Its not a 'texture', its a heightmap. That I want to never 'display', but I want to
read through it on a pixel-by-pixel basis and save into a custom-structure data file.
This datafile is my (currently in proof-of-concept testing) way of storing the heightmap of 'the entire world'.
So as you can imagine, its BIG, really BIG, you wont believe how vastly, hugely, mind-bogglingly
big it is, you might think its a long way down the street to the chemist, but thats just peanuts to ....
[REDUCTED]

So, with all this known, I feel IF I had some ideas how to start, I could access the texture via the
bmap.finalbits or even the bmap.d3dtex pointers.
But I dont where to start with 16bit floats... Floats are an unknown country to me...

I was HOPING for an easier way, but it looks like I may have no choise.
This is only a TOOL anyway, so speed is not so essential...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1