therfiles Posted February 9, 2014 Posted February 9, 2014 Hey guys! Been derping around in GTK recently, and I've been trying to create a cool "security room" where the player can browse various camera feeds from the entire facility. Pretty neat. Then, I thought it could be cool for, instead of the player pressing a button and using a misc_camera to view the scene, the camera viewpoints to be displayed on the wall (as a 'texture') so I could have like 6 camera panels each showing feeds from the map. So I've been googling around and looking info up about misc_portal_surfaces, which I gather are used for mirrors, but can also be used to do what I've described. I'm still a little bit shaky on what to do. Here's my current "target order": Brush (textured with portal on one side) | misc_portal_surface > misc_portal_camera > target_position Is this right? I made sure the misc_portal_surface is really close to the brush, but right now it doesn't draw anything. Any thoughts? Thanks!
MoonDog Posted February 9, 2014 Posted February 9, 2014 What shader do you have applied to the surface? I recall having issues with those surfaces when I had r_fastsky turned on as well. therfiles likes this
mrwonko Posted February 9, 2014 Posted February 9, 2014 Besides your current troubles, keep in mind that you can only have one portal in view at any time. If you have multiple (e.g. 6) only one will be displayed. therfiles likes this
Solution Szico VII Posted February 9, 2014 Solution Posted February 9, 2014 First off, here's a shader that works: textures/blueice_nightfall/nightfall_camera { qer_editorimage textures/blueice_nightfall/nightfall_cameraportal surfaceparm playerclip surfaceparm nolightmap portal { map textures/blueice_nightfall/nightfall_camera blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA depthWrite alphaGen portal 2048 } } The image is just that of a glass texture - you can use whatever you like. Entity should be as follows: misc_portal_surface --> misc_portal_camera --> target_position And what Mr Wonko said. Your cameras would need to be seperated (vis wise) from each other else only one will be drawn. Perhaps you could have a trigger system that switches the camera view instead of 6 simultaneous screens eezstreet, PK_Azlon and therfiles like this
PK_Azlon Posted February 9, 2014 Posted February 9, 2014 Perhaps you could have a trigger system that switches the camera view instead of 6 simultaneous screens I am intrigued by this idea. How would one go about setting that up?
therfiles Posted February 9, 2014 Author Posted February 9, 2014 You'd have to switch the misc_portal_camera the misc_portal_surface is targeted to...maybe by script?
Szico VII Posted February 9, 2014 Posted February 9, 2014 Just have the brush your portal texture is on set as a func_useable. Then set up 5 more func_useables with camera connections (thats 6 sets of each entity ex.useables in total so 18 entities) for each of your 6 views. Then you can simply swap between them using triggers and or script.Or, if you like scripting you could feasibly change the target of the cameras to different target positions via script without needing so many entities. Morabis and therfiles like this
eezstreet Posted February 9, 2014 Posted February 9, 2014 Hey guys! Been derping around in GTK recently, and I've been trying to create a cool "security room" where the player can browse various camera feeds from the entire facility. Pretty neat. Then, I thought it could be cool for, instead of the player pressing a button and using a misc_camera to view the scene, the camera viewpoints to be displayed on the wall (as a 'texture') so I could have like 6 camera panels each showing feeds from the map. So I've been googling around and looking info up about misc_portal_surfaces, which I gather are used for mirrors, but can also be used to do what I've described. I'm still a little bit shaky on what to do. Here's my current "target order": Brush (textured with portal on one side) | misc_portal_surface > misc_portal_camera > target_position Is this right? I made sure the misc_portal_surface is really close to the brush, but right now it doesn't draw anything. Any thoughts? Thanks!mate. its Radiant, not GTK therfiles likes this
therfiles Posted February 9, 2014 Author Posted February 9, 2014 textures/blueice_nightfall/nightfall_camera { qer_editorimage textures/blueice_nightfall/nightfall_cameraportal surfaceparm playerclip surfaceparm nolightmap portal { map textures/blueice_nightfall/nightfall_camera blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA depthWrite alphaGen portal 2048 } } Thanks, @@Szico VII! Do you mind if I adapt that shader for my own use? I really appreciate the help. I think I'll try it with a script if I can't get all 6 to draw simultaneously mate. its Radiant, not GTK
MoonDog Posted February 9, 2014 Posted February 9, 2014 No need for a crazy amount of entities. If you want to keep it simple, you don't even have to make the script dynamic. You can make it situationally specific, rotating through a series of misc_portal_cameras. //Generated by BehavEd if ( $get( FLOAT, "SET_PARM1")$, $=$, $0$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "1" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam1" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $1$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "2" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam2" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $2$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "3" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam3" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $3$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "4" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam4" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $4$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "0" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam0" ); } } } } } } therfiles likes this
Szico VII Posted February 9, 2014 Posted February 9, 2014 Thanks, @@Szico VII! Do you mind if I adapt that shader for my own use? I really appreciate the help. I think I'll try it with a script if I can't get all 6 to draw simultaneously No worries, that shader is hardly proprietary to me anyway really Also, mine says "GTK" Radiant when it starts up. If I see GTK, I know what it is, even if the generic program name for idtech3 is a radiant level editor therfiles likes this
MoonDog Posted February 9, 2014 Posted February 9, 2014 Also, mine says "GTK" Radiant when it starts up. If I see GTK, I know what it is, even if the generic program name for idtech3 is a radiant level editor http://en.wikipedia.org/wiki/GTK%2B eezstreet likes this
therfiles Posted February 9, 2014 Author Posted February 9, 2014 No need for a crazy amount of entities. If you want to keep it simple, you don't even have to make the script dynamic. You can make it situationally specific, rotating through a series of misc_portal_cameras. //Generated by BehavEd if ( $get( FLOAT, "SET_PARM1")$, $=$, $0$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "1" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam1" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $1$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "2" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam2" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $2$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "3" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam3" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $3$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "4" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam4" ); } } else ( ) { if ( $get( FLOAT, "SET_PARM1")$, $=$, $4$ ) { set ( /*@SET_TYPES*/ "SET_PARM1", "0" ); affect ( $script_portal_surface$, /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_TARGET", "script_cam0" ); } } } } } } Thanks, @@MoonDog. That's what I was thinking of doing!
eezstreet Posted February 9, 2014 Posted February 9, 2014 No worries, that shader is hardly proprietary to me anyway really Also, mine says "GTK" Radiant when it starts up. If I see GTK, I know what it is, even if the generic program name for idtech3 is a radiant level editorIt's Radiant. But made in GTK. Hence, GTK Radiant. It should be referred to as Radiant, not GTK. There could also be all kinds of other Radiants, like Qt Radiant, Unity Radiant, etc. http://en.wikipedia.org/wiki/GTK%2BSO MUCH THIS.
therfiles Posted February 9, 2014 Author Posted February 9, 2014 Alternatively, it seems like you could just target the misc_portal_surface to multiple misc_portal_cameras, add a wait key to the misc_portal_surface, and the game will automatically cycle though the cameras...
Szico VII Posted February 9, 2014 Posted February 9, 2014 Will it cycle through logically though or would it randomly go to different cameras? Does that even work?
ensiform Posted February 9, 2014 Posted February 9, 2014 You should also know that dynamic glow makes mirrors/portals not work too. therfiles and eezstreet like this
therfiles Posted February 10, 2014 Author Posted February 10, 2014 Ok, so I'm having a bit of trouble. I can get the camera to work, but it only will draw entities. For example, it will only draw my doors, func_walls, effects, etc. And it still acts like a mirror if you turn your view point enough. Does it need a special compile or something? And the floor will sometimes draw, but when you get closer, these brushes just disappear...
Szico VII Posted February 10, 2014 Posted February 10, 2014 Its still a portal so it is actually drawing the entire scene in real time 3d as you view it through the portal surface.
therfiles Posted February 10, 2014 Author Posted February 10, 2014 Hm...Should I compile it with -vis? When ever I attempt it it says it cannot find "mapname.prt". I just confused about what I'm doing wrong. It gives me the HOM effect with anything that isn't an ent. I tried a simple mirror and it worked great. It's the cameras that have messed it up...
MoonDog Posted February 10, 2014 Posted February 10, 2014 Hm...Should I compile it with -vis? When ever I attempt it it says it cannot find "mapname.prt". I just confused about what I'm doing wrong. It gives me the HOM effect with anything that isn't an ent. I tried a simple mirror and it worked great. It's the cameras that have messed it up... You probably have a leak in the bsp that is preventing you from saving a prt file. therfiles likes this
therfiles Posted February 10, 2014 Author Posted February 10, 2014 That makes sense. I believe I do have a leak, so I'll just make a big box around the map to prevent that as a test. I do need to fix those silly leaks soon Thanks, @@MoonDog!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now