3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: bmap_process after level_load crashes
[Re: Widi]
#392386
01/22/12 03:05
01/22/12 03:05
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
If that Bitmap is used in your level later on, did you remember you have to convert it back? bmDest is automatically converted to a render target on the first call of this function. For accessing pixels of the bitmap afterwards, it can be converted back to a pixel format (bmap_to_format) or blitted onto another bitmap (bmap_blit).
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: bmap_process after level_load crashes
[Re: Uhrwerk]
#392428
01/22/12 11:33
01/22/12 11:33
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
OP
Serious User
|
OP
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
No, i use it like in the example from the manual in a Panel.
PANEL* panTarget = { bmap = "#256x256x24"; flags = SHOW; } // target bmap
BMAP* bmSrc = "image.tga"; // source bmap
MATERIAL* mtlSepia = { // sepia coloring pixel shader
effect = "
Texture TargetMap; // source bitmap
sampler2D smpSrc = sampler_state { texture = <TargetMap>; };
float4 SepiaColor1 = {0.2, 0.05, 0.0, 1.0};
float4 SepiaColor2 = {1.0, 0.9, 0.5, 1.0};
float4 process_sepia(float2 Tex: TEXCOORD0): COLOR
{
float4 Color = tex2D( smpSrc, Tex.xy);
float sepiaLerp = dot( float3(0.3, 0.59, 0.11), Color);
return lerp(SepiaColor1,SepiaColor2,sepiaLerp);
}
technique Sepia {
pass p1 {
AlphaBlendEnable = false;
PixelShader = compile ps_2_0 process_sepia();
}
}
";
}
function main()
{
wait(1); // until DirectX device is opened
level_load ("Level_1.wmb");
bmap_process(panTarget.bmap,bmSrc,mtlSepia);
}
That crashes, but without the level_load is all ok.
|
|
|
Re: bmap_process after level_load crashes
[Re: Widi]
#392512
01/23/12 16:59
01/23/12 16:59
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
OP
Serious User
|
OP
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
|
|
|
Re: bmap_process after level_load crashes
[Re: Widi]
#392521
01/23/12 19:07
01/23/12 19:07
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
I just did a quick check on my computer. Your sample code runs perfectly fine on my machine, regardless if you comment or uncomment the level_load statement. So basically I see four possible error sources: - Your .wmb file is damaged. Recompiling should solve the issue then.
- Your source image is somehow different or damaged. I made a 24 bit .tga file.
- Your hardware or any of your drivers is causing the problem.
- You posted only an excerpt of your code and something totally different is causing the problem.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: bmap_process after level_load crashes
[Re: Uhrwerk]
#392575
01/24/12 16:15
01/24/12 16:15
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
OP
Serious User
|
OP
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
Thank you for trying that out so i know the fault is here by me. 1. It also crashes if i use "level_load(NULL)" so i think my .wmb is not damaged. Will try later with a minimal level. 2. I save the image with paint.net as a 24 bit .tga file (tried already with .bmp) 3. Will try it next week on a other PC, no time this week because i am busy at WEF in Davos  4. No more code. I reduce all for testing to the code i posted already.
|
|
|
Re: bmap_process after level_load crashes
[Re: Widi]
#392580
01/24/12 17:42
01/24/12 17:42
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
I did some additional tests in order to help you hunt that down.
I used Paint.net as well, tga, 24 bits, RLE compressed, image sizes 256*256, 512*512 and 500*500. I tried it with level_load(NULL) and level_load("testmap.wmb"). In any of the above cases the code ran totally fine.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|