Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems with NOSKY #411489
11/17/12 11:39
11/17/12 11:39
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline 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:

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
Re: Problems with NOSKY [Re: MasterQ32] #411875
11/20/12 16:10
11/20/12 16:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
For clearing the sky, use a sky color. NOSKY must then not be set of course.

Alternatively, use view->bg for defining a background color that is different to the sky color.

Re: Problems with NOSKY [Re: jcl] #411895
11/20/12 22:53
11/20/12 22:53
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i know that i can clear the background to skycolor, but i also need to clear some other rendertargets to other colors than skycolor

i have 4 different render targets:
the first should be cleared to zero, the second one to black, third one to ambient_color and the last one to zero
the last pass renders to the screen and has to be cleared to sky_color

so just using sky_color won't work


Visit my site: www.masterq32.de
Re: Problems with NOSKY [Re: jcl] #411914
11/21/12 09:50
11/21/12 09:50
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Originally Posted By: jcl
Alternatively, use view->bg for defining a background color that is different to the sky color.

Re: Problems with NOSKY [Re: jcl] #411917
11/21/12 09:53
11/21/12 09:53
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i know this.
but it doesn't work in view stages, only with camera!


Visit my site: www.masterq32.de
Re: Problems with NOSKY [Re: MasterQ32] #411919
11/21/12 10:08
11/21/12 10:08
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I've just checked, but can not confirm that problem.

Maybe something in your code sets bg to zero? It only clears the background when it's nonzero.

Re: Problems with NOSKY [Re: jcl] #411920
11/21/12 10:10
11/21/12 10:10
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
have you used the script above?
i tried this and it doesn't work
can check it this evening again, but i'm certainly sure that it was like described
(pressing space in the test code to setup NOSKY and bg)


Visit my site: www.masterq32.de
Re: Problems with NOSKY [Re: MasterQ32] #411926
11/21/12 10:46
11/21/12 10:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
In your script you're setting the CHILD flag. This lets the view inherit the parameters from the preceding stage, so your bg setting has no effect. Only the NOSKY flag did work because flags are not inherited.

Re: Problems with NOSKY [Re: jcl] #411945
11/21/12 13:23
11/21/12 13:23
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
okay, that means that i have to copy all those parameters by myself but changing bg...
thanks for the help


Visit my site: www.masterq32.de
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 Offline
Expert
EvilSOB  Offline
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

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1