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:

Code:
#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:

Code:
#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 wink


Visit my site: www.masterq32.de