Jump to content
The Dark Mod Forums
Sign in to follow this  
Bikerdude

Faux inside/outside window views?

Recommended Posts

Now that we have a better working version of ENV snapshot, whats the best way to take an ENV shot from inside and outside the windows so we can have fake inside/outside views using the display part security camera entity..?

 

Im looking to create a better version of what Kingsal created in his first mission.

Edited by Bikerdude

Share this post


Link to post
Share on other sites

Haven't seen what Kingsal did, but security camera doesn't sound like an optimized solution. This is a trick known for years (UE3/UDK era), and should be doable on any engine now:

 

Does our iteration of idtech4 use parallax maps/bump offset?

Share this post


Link to post
Share on other sites

Haven't seen what Kingsal did, but security camera doesn't sound like an optimized solution. This is a trick known for years (UE3/UDK era), and should be doable on any engine now:

 

Does our iteration of idtech4 use parallax maps/bump offset?

 

That is a nice trick i didn't knew about it, thanks for the video.

 

About if TDM engine supports parallax maps, i don't think so, there's no cvar to control parallax maps like you have on fhdoom, but i also seem to vaguely remember someone showing parallax occlusion mapped materials in here but i'm not sure, if it does and it works like fhdoom then is just a matter of putting the bump map in the alpha channel of the specular map.

 

About that bump offset shader i don't think that is done with a normal parallax map, you can see the texture is a colored one ( object space normal map? ) not a grayscale bump map?

 

I'm sure this would need for someone that knows GLSL to write a bump offset shader and without knowing how the UE4 one is done, i'm sure is not easy.

 

Also http://www.humus.name/index.php?page=3D&ID=80

 

And for OpenGL https://www.opengl.org/discussion_boards/showthread.php/165407-Interior-Mapping-%28Humus-demo%29

Edited by HMart

Share this post


Link to post
Share on other sites

About that bump offset shader i don't think that is done with a normal parallax map, you can see the texture is a colored one.

 

Nope, that can be done with heightmap, but this example just uses a negative value (constant 1 vector), since it basically needs to make a flat surface behave more like a sphere or a cylinder. The image is a shot of interior, which is cheaper and faster than using a whole cubemap.

  • Like 1

Share this post


Link to post
Share on other sites

Going back to my question in the OP, now thinking about it I don't think a security camera is needed. But the patch showing the fake view is an entity, I just can't remember which one. I mahevto do some forum digging.

Share this post


Link to post
Share on other sites

And from memory, an ENV shot creates a cube map. I just need to figure how to display that on a patch.

Edited by Bikerdude

Share this post


Link to post
Share on other sites

For cube maps in materials with cubeMap/cameraCubeMap see e.g. textures/glass/dull_opaque01. (I'm not sure whether texgen reflect will suit faked views 'through' the window though.)

 

For real time remote views I think you can just use func_cameraview, rather than having everything func_securitycamera brings.

 

Edit: regarding parallax, http://forums.thedarkmod.com/topic/19147-parallax-corrected-cubemaps/ may be relevant.

Edited by VanishedOne

Share this post


Link to post
Share on other sites

And from memory, an ENV shot creates a cube map. I just need to figure how to display that on a patch.

 

To display that on a map just use cameraCubeMap.

{
   blend           add
   cameraCubeMap   env/cloudy  
   texgen          skybox
   rgb             .6
}

For cube maps in materials see e.g. dull_opaque01. (I'm not sure whether texgen reflect will suit faked views 'through' the window though.)

 

For real time remote views I think you can just use func_cameraview, rather than having everything func_securitycamera brings.

 

I'm not sure but logically texgen skybox should be better because simulating a interior is not different from simulating a skybox.

 

edit: hum a skybox expects the player to be inside it, in this case is more the player looking from the outside in.

Edited by HMart

Share this post


Link to post
Share on other sites

Not interested in generating random views, its has to be out the actual inside and outside area's in the map, hence doing a ENV cubmap.

 

So, you want to make a fake interior reflection, and there will be actual interior behind such window? That's not the point of making such materials. It will look off, especially for fake exteriors, as cubemaps aren't parallax corrected.

Share this post


Link to post
Share on other sites

So, you want to make a fake interior reflection, and there will be actual interior behind such window? It will look off, especially for fake exteriors, as cubemaps aren't parallax corrected.

Not a reflection per-se, more like how the skybox works? My thinking is I make 2x cubmap textures. One of the inside and the outside, I then place a patch in the window that shows inside/outside.

Share this post


Link to post
Share on other sites

Cubemaps are "moving" along the surface when player moves. It will look off, especially when player gets close. Not sure where you want to put these patches, and why you need patches in the first place. To make the effect similar to what's in the video, you could just make a window with translucent material and put a kind of half-dome with one texture that would be an interior shot behind it. But, that would make more sense for fake interiors. Unless you're making separate spaces for inside and outside (like for a house that is basically impenetrable fortress, except for some vents, where you can teleport player from one section of a vent to the other, so it's unnoticeable), that's not going to work well. It's probably better to build the space first, and then see how you can pull this trick off, and whether it's worth it. Players will look at it for like a second or two and move on to other things anyway.

Share this post


Link to post
Share on other sites

Ah dag nammit, I did wonder if that was going to happen. Is that why people have been mentioning parallax mapping..?

 

And the patches would be placed either side of the window, so I will pm Kingsal to see if his method might be useable.

Share this post


Link to post
Share on other sites

This mission uses either real interiors behind translucent windows (with heat haze distortion), or opaque windows with generic reflection of the exterior.

Share this post


Link to post
Share on other sites

Not sure what you are referring to in my map, Biker.

 

Maybe the portals in cauldron? I used a trick there where the surface of a portal you go through shows whats behind it (or on the OtherSide). I used a unique env cubmap for each portal surface. It works okay in the context of a magical portal , but will look weird if you are accurately trying to represent a space. Not to mention it was a huge pain in the ass to do and you would have to create a unique cubemap for each window/ interior space.

 

As for as I know, TDM does not support the parallax offset to make that convincing. There might be a work around, but I don't know what that would be.

Share this post


Link to post
Share on other sites

Not sure what you are referring to in my map, Biker.

You made cubemap textures via env shot and used that on patches just inside the windows

Edited by Bikerdude

Share this post


Link to post
Share on other sites

As for as I know, TDM does not support the parallax offset to make that convincing. There might be a work around, but I don't know what that would be.

 

That would have to be a shot of fake interior projected onto kind of half-dome or similar shape placed behind translucent glass.

Share this post


Link to post
Share on other sites

You made cubemap textures via env shot and used that on patches just inside the windows

 

Hmm, I don't think that was me. Only cube maps I've used are for water and the portal thing.

 

 

That would have to be a shot of fake interior projected onto kind of half-dome or similar shape placed behind translucent glass.

 

So you mean like a fake interior texture just warped around a lens shape instead of a cube map?

Share this post


Link to post
Share on other sites

I have occasionally brought up this topic in relation to this wiki:

 

http://wiki.thedarkmod.com/index.php?title=Cube_maps

 

The cubemap "reflection" in this wiki looks very much like an "interior map" where

the image convolution does a pretty good job of faking a cube shaped room past a portal.

 

In this way, we can already sorta do this.

 

However, we lack the ability to control the convolution in an easy way and nor do we have an easy way

to gather screenshots from the precise location needed to create this illusion.

Share this post


Link to post
Share on other sites

 

That would have to be a shot of fake interior projected onto kind of half-dome or similar shape placed behind translucent glass.

 

Yes that would be a nice trick, I assume the image would be mapped on the inside of the dome? Btw wouldn't be very heavy, but is labor intensive and perhaps requires a script that detects the player and makes the half dome look always at the him when he moves, like the flares on lights.

 

 

...

 

So you mean like a fake interior texture just warped around a lens shape instead of a cube map?

 

Yes

 

I have occasionally brought up this topic in relation to this wiki:

 

http://wiki.thedarkmod.com/index.php?title=Cube_maps

 

The cubemap "reflection" in this wiki looks very much like an "interior map" where

the image convolution does a pretty good job of faking a cube shaped room past a portal.

 

In this way, we can already sorta do this.

 

However, we lack the ability to control the convolution in an easy way and nor do we have an easy way

to gather screenshots from the precise location needed to create this illusion.

 

Oh I saw that before I totally forgot.

 

Btw about that wiki tut even tho I didn't tested it, I think there's a way to solve the problem referred on that wiki page, the one about the light being off on the world and not on the cube map reflection, this if you want to make that trick more dynamic but is labor intensive... first make cube maps for all light states that you can have on that room (to save work don't use many lights :P ), then make a material like so for the water:

material name
{
   
   qer_editorimage .....
   
   {
         if ( parm7 == 0 )  // default cubemap all lights on
         blend         gl_dst_alpha, gl_one
         maskalpha
        cubeMap        env/env1
        texgen        reflect
    }
    {
         if ( parm7 == 1 ) // cubemap light 1 off
         blend         gl_dst_alpha, gl_one
         maskalpha
        cubeMap        env/env2
        texgen        reflect
    }
    etc...
} 

then make a script where you set the parm7 value depending on the light being off, to turn on/off the material stages, if you (the one reading this) don't know how to script you can do the same on the editor with the "target_setshaderparm", like so, target one light at one "target_setshaderparm" entity and in it, set the desired value for the shaderParm7 key, then target that "target_setshaderparm"at the water surface entity, do this for all lights. Btw this also doesn't solve the problem of movables not being updated on the cube map, so only put static objects near the water.

 

Again i didn't tested this so if it doesn't work don't blame me. :P (but it should work...)

Edited by HMart
  • Like 1

Share this post


Link to post
Share on other sites
So you mean like a fake interior texture just warped around a lens shape instead of a cube map?

 

Yes. A rough example:

obraz.png

obraz.png

 

 

The interior is a bit warped at the edges of the dome, but you get the general idea. It looks better than a cubemap because the illusion of depth works better.

Edited by Judith
  • Like 2

Share this post


Link to post
Share on other sites
Yes that would be a nice trick, I assume the image would be mapped on the inside of the dome? Btw wouldn't be very heavy, but is labor intensive and perhaps requires a script that detects the player and makes the half dome look always at the him when he moves, like the flares on lights.

 

It's not really hard work, you just need to take a screenshot of your scene, or find some matching image on the internet, as I did. It doesn't need any scripts, and it's less complicated than most of the ideas above. It's just a simple planar projection with some gradient shadow around the image. You don't even have to worry about the relative size of such texture, as you can scale it down with the image projection for your model and use zeroclamp in the material, so it doesn't tile.

 

Edited by Judith
  • Like 4

Share this post


Link to post
Share on other sites

Hmm, I don't think that was me. Only cube maps I've used are for water and the portal thing.

Oops sorry it was Kvorning

In this way, we can already sorta do this.

This is exactly! what I am after, but I will be taking ENV shots of the actual rooms so when youre outside you can see the inside and visa versa without a performence hit.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...