|
Help!
by VoroneTZ. 10/14/25 05:04
|
|
|
|
|
|
|
|
1 registered members (AndrewAMD),
7,782
guests, and 2
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 
|
|
|
|