Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 735 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Postprocessing that only colour / show selected models [SOLVED] #365452
03/26/11 20:43
03/26/11 20:43
Joined: Nov 2008
Posts: 15
H
Hallucinogen Offline OP
Newbie
Hallucinogen  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 15
Hi,

Im currently trying to put together a thermal vision effect that will render everything but the character models blue and a second view that is applied over the top of the 'blue' view that will colour only the characters.

To achieve the 'blue' effect im using the postprocessing toon shader with outline from the Wiki and the same for the second view for character models that is red. My problem is that i seem to only be able to have one view or the other.

I have set up the tree models, bushes and terrain with FLAG1 so that the second red view does not pick them up... but FLAG1 does not seem to be working when i set 'NOFLAG1' in the red view.

Below is the blue view



and below is the red view that still picks everything else up and colours it red if i make it visible.



Below is the code i have

Code:
MATERIAL* Toon_mat =
{
	effect = "Toon_.fx";
}

MATERIAL* Thermal_mat =
{
	effect = "Toon_.fx";
}

VIEW* Heat_VISIONVIEW = {layer = 1; flags = PROCESS_TARGET;}
VIEW* Thermal_ModelView = {layer = 1.5; flags = PROCESS_TARGET | NOFLAG1;}



Other code just assigns the materials to views and to stages which is pretty solid. also trees and bushes etc have set(my, FLAG1);

Is there a bug in NOFLAG1 or am i totally off from the effect im trying to create? Bascially to bring both views together but red should only appear on chosen models and ignore the rest which will then shade everything blue.

Kind regards

Last edited by Hallucinogen; 03/27/11 15:27.
Re: Postprocessing views that only colour / show selected models [Re: Hallucinogen] #365454
03/26/11 20:58
03/26/11 20:58
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
No bug. You probably should've asked this in the "Shaders" forum. Post-process effects only act on images -- such as the bmap generated by a view, so NOFLAG1 on a PROCESS_TARGET view is useless.

I think there are two ways to approach this:

1. Do the toon effect in the object shader. No post-process -- when you are in thermal mode you set the camera's material to Thermal_mat or wahtever, and have a material event (ENABLE_RENDER) that sets material skills (for colour) based on each entity's own skills. The main disadvantage is that if you want the toon effect to take into account things like shadows, specularity, and transparency, the one shader has to handle this for all different material types. In practice this may not be noticeable to a user in thermal mode, and if you think about it will not matter for something like a thermal view.

2. Post-process white toon effect, but multiply it by a colour map that will make some parts red and some parts blue. You'd either need another view for this (this could be quite bad for your framerate) or, since most cards these days support multiple render targets (MRTs), just have each entity's shader output a red colour or blue colour to another render target. The disadvantage here is either speed (the first case), or having to modify every shader to use MRTs and output a colour (the second case).

1 is ideal, IMHO.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: Postprocessing views that only colour / show selected models [Re: JibbSmart] #365455
03/26/11 21:04
03/26/11 21:04
Joined: Nov 2008
Posts: 15
H
Hallucinogen Offline OP
Newbie
Hallucinogen  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 15
Thanks for that. Will give it a shot with those different approachs

Many thanks for that

Re: Postprocessing views that only colour / show selected models [Re: Hallucinogen] #365456
03/26/11 21:08
03/26/11 21:08
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
You're welcome laugh And I should've mentioned -- I think this will look very cool once you have it working. Obviously a dramatisation of how thermal vision works, but games should look cool rather than real, and from those screenshots I reckon it'll look cool.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: Postprocessing views that only colour / show selected models [Re: JibbSmart] #365457
03/26/11 21:20
03/26/11 21:20
Joined: Nov 2008
Posts: 15
H
Hallucinogen Offline OP
Newbie
Hallucinogen  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 15
Thanks buddy, originally i wanted to try and acvhieve it through views rather than object shaders so that if a character moves or the camera moves whist in Thermal mode i could set up a blur shader that would smear the heat signature over the screen for a limited time without distorting the blue 'background' view. Guess i thourght this would of been an easier option lol

Re: Postprocessing views that only colour / show selected models [Re: Hallucinogen] #365461
03/26/11 23:07
03/26/11 23:07
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
Just use a full-screen blur then, will look pretty cool too I think laugh


Teleschrott-Fan.
Re: Postprocessing views that only colour / show selected models [Re: Hallucinogen] #365565
03/27/11 15:20
03/27/11 15:20
Joined: Nov 2008
Posts: 15
H
Hallucinogen Offline OP
Newbie
Hallucinogen  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 15
Well after playing around i decided to totally get rid of the 'red view' and by accident found out that the toon shader does not just colour everything in the selected colour, but if you put low values into the RGB floats it kinda... magnifies the colours. so ive kept thermal view and just alter the light values to blue and set my character models to UNLIT and this is the end result:

Normal View



Thermal View



Needs tweaking a little more. As you can see its based around the Predator. not for a commercial project but an experiment to see just how close to the original movies you can go when your not working for a big company (which is why i really wanted to keep the blue thermal background as it looks very much like the original as opposed to just changing fog colours, textures etc)

Re: Postprocessing that only colour / show selected models [SOLVED] [Re: Hallucinogen] #365576
03/27/11 16:27
03/27/11 16:27
Joined: Nov 2008
Posts: 15
H
Hallucinogen Offline OP
Newbie
Hallucinogen  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 15
Few more Screenshots with the help of Shade-C



Now the heat signature is blurred by setting the depth of the model then setting it back once in normal view




Moderated by  Blink, Hummel, Superku 

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