0 registered members (),
677
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Problems with NOSKY
#411489
11/17/12 11:39
11/17/12 11:39
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
OP
Expert
|
OP
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
Hey! I'm just working on a render pipeline and need to clear some render target to another color than sky color my first thought was using the NOSKY-Flag. I've made a small test to check if it's the right flag to use here:
#include <acknex.h>
#include <default.c>
function on_space_event()
{
camera->flags |= NOSKY;
camera->bg = pixel_for_vec(COLOR_RED, 100, 8888);
}
function main()
{
wait(1);
level_load(NULL);
ent_create(CUBE_MDL, vector(64, 0, 0), NULL);
ent_create(CUBE_MDL, vector(-64, 0, 0), NULL);
ent_create(CUBE_MDL, vector(0, 64, 0), NULL);
ent_create(CUBE_MDL, vector(0, -64, 0), NULL);
camera->bmap = bmap_createblack(screen_size.x, screen_size.y, 888);
while(1)
{
camera->pan += 2 * time_step;
draw_quad(camera->bmap, nullvector, NULL, screen_size, NULL, NULL, 100, 0);
wait(1);
}
}
This worked like expected, red background, not sky color But then i tried to use the same approach in a render chain, so using the same code just with a stage view:
#include <acknex.h>
#include <default.c>
VIEW *pass =
{
flags = CHILD;
}
function on_space_event()
{
pass->flags |= NOSKY;
pass->bg = pixel_for_vec(COLOR_RED, 100, 8888);
}
function main()
{
wait(1);
level_load(NULL);
ent_create(CUBE_MDL, vector(64, 0, 0), NULL);
ent_create(CUBE_MDL, vector(-64, 0, 0), NULL);
ent_create(CUBE_MDL, vector(0, 64, 0), NULL);
ent_create(CUBE_MDL, vector(0, -64, 0), NULL);
camera->bmap = bmap_createblack(screen_size.x, screen_size.y, 888);
pass->bmap = bmap_createblack(screen_size.x, screen_size.y, 888);
camera->stage = pass;
while(1)
{
camera->pan += 2 * time_step;
draw_quad(pass->bmap, nullvector, NULL, screen_size, NULL, NULL, 100, 0);
wait(1);
}
}
And it doesn't work. The models smear over the screen and the background gets not cleared correctly (it doesn't get cleared in any way) Is this a wanted behaviour or is this a bug? Would be cool to get an answer soon! Greetings Felix Queißner PS.: I can use a dirty workaround, but it would be better to use the correct flags for this
|
|
|
Re: Problems with NOSKY
[Re: MasterQ32]
#411946
11/21/12 13:28
11/21/12 13:28
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Please forgive the noob suggestion...
Couldnt you keep the CHILD flag, change the BG of the 'parent' at the start of 'this' stage, then set the parent BG back to its original?
Or is that even more 'messing about' than a simple memcpy?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|