3 registered members (AndrewAMD, alibaba, Quad),
761
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
bmap_fill crashes on- and bmap_save doesnt save huge bitmaps
#421023
04/08/13 17:08
04/08/13 17:08
|
Joined: Jul 2001
Posts: 6,904
HeelX
OP
Senior Expert
|
OP
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Hi, I want to create and save a huge skybox texture, but I noticed that for heights > 1024px bmap_fill crashes and bmap_save doesn't save the bitmap. With the following example code you can reproduce it:
int main ()
{
wait(3);
int w = 2048; // works for 1024 and less!
BMAP* b = bmap_createblack(w * 6, w, 8888); // or 24, format doesn't matter here
if (b != NULL)
{
// bmap_fill(b, COLOR_BLUE, 100); // error: "Script crash in main"
bmap_save(b, "bigblue.tga"); // nothing is saved
}
}
Last edited by HeelX; 04/08/13 17:08.
|
|
|
Re: bmap_fill crashes on- and bmap_save doesnt save huge bitmaps
[Re: HeelX]
#421053
04/09/13 07:23
04/09/13 07:23
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
you nedd 3 tricks and it works (I had a lot of problems with where to use waits in image manipulations...):
#include <acknex.h>
int main ()
{
level_load(NULL);
wait(3);
d3d_texlimit = 2048 * 6;
int w = 2048;
BMAP* b = bmap_createblack(w * 6, w, 888); // or 24, format doesn't matter here
wait(1);
if (b != NULL)
{
bmap_fill(b, COLOR_BLUE, 100);
wait_for(bmap_fill);
bmap_save(b, "bigblue.tga");
}
}
but d3d_texlimit is 3d card dependent...
Last edited by sivan; 04/09/13 07:29.
|
|
|
|