Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Different background color on different views #342752
09/30/10 17:19
09/30/10 17:19
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline OP
User
BoH_Havoc  Offline OP
User

Joined: Jun 2004
Posts: 655
to your left
Hi,
i was wondering how one could apply a different background/sky_color to different views?
I need a black sky for one of my shaders, but on the other hand, i also need a pure white one for another shader...so i have a problem here, as i can't use sky_color.

View1 = black sky/background
View2 = white sky/background

Any ideas? laugh


Shade-C EVO Lite-C Shader Framework
Re: Different background color on different views [Re: BoH_Havoc] #342755
09/30/10 18:03
09/30/10 18:03
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
if(render_view == View1) {vec_set(sky_color,vector(0,0,0))};
if(render_view == View2) {vec_set(sky_color,vector(255,255,255))};

or use you the different views simultaneous?

Re: Different background color on different views [Re: jane] #342763
09/30/10 18:59
09/30/10 18:59
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
There is probably a much better way of "getting" the colors than this,
but the " view.dwcolor = " MAY enable you to set the different colors.

Code:
// generate the color "codes"
long long_white;
long long_black;

void main()
{  
   ...
   vec_set(sky_color, vector(255,255,255));  long_white = camera.dwcolor;
   vec_set(sky_color, vector(0,0,0));        long_black = camera.dwcolor;
   vec_set(sky_color, [i]normal[/i]);
   ...
   ...
   View1.dwcolor = long_black;
   View2.dwcolor = long_white;
...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Different background color on different views [Re: EvilSOB] #342768
09/30/10 19:53
09/30/10 19:53
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline OP
User
BoH_Havoc  Offline OP
User

Joined: Jun 2004
Posts: 655
to your left
jane:
I already tried that method, but it's VERY unflexible and makes life much harder for me. Each time i need another background color i would have to rewrite code all over the place. I also would have to set the ENABLE_VIEW flag for each material, which i absolutely do not want.
Yes, i render both views (i actually have more) at the same time...so this really is unflexible.

EvilSOB:
That's exactly what i was looking for. A simple and easy method to change the background without rewriting all my code. Unfortunally it doesn't work frown Would have been to easy...

Any more ideas? laugh


Shade-C EVO Lite-C Shader Framework
Re: Different background color on different views [Re: BoH_Havoc] #342772
09/30/10 20:17
09/30/10 20:17
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
its an option to use the screen_color(default:0 -> black) to View1 and sky_color to View2

or target1,target2,target3 with COLOR1,COLOR2,COLOR3
to change the bmap_createblack color?

Last edited by jane; 10/01/10 01:27.
Re: Different background color on different views [Re: BoH_Havoc] #343320
10/05/10 13:14
10/05/10 13:14
Joined: Oct 2002
Posts: 806
Zapan@work Offline
User
Zapan@work  Offline
User

Joined: Oct 2002
Posts: 806
We used something like that for our splittscreen game: just create a view-entity (skycube etc.) and asign the client_id of the ent to the view... this works just fine!

Re: Different background color on different views [Re: Zapan@work] #343321
10/05/10 13:28
10/05/10 13:28
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
They just have implemented background colors in beta a week ago:

Quote:
The bg parameter allows to clear a VIEW to a certain value.

It seems Conitec needed different background colors for the new PSSM script, its always good when they do such scripts because then they notice whats missing.


Moderated by  HeelX, Spirit 

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