Jump to content


Photo

Faux inside/outside window views?


34 replies to this topic

#1 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 29 October 2018 - 03:08 AM

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, 29 October 2018 - 05:49 AM.


#2 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 29 October 2018 - 04:41 AM

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?



#3 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 742 posts

Posted 29 October 2018 - 09:09 AM

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.nam...p?page=3D&ID=80

 

And for OpenGL https://www.opengl.o...ng-(Humus-demo)


Edited by HMart, 29 October 2018 - 09:17 AM.


#4 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 29 October 2018 - 09:32 AM

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.


  • HMart likes this

#5 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 29 October 2018 - 11:46 AM

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.

#6 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 29 October 2018 - 11:47 AM

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, 29 October 2018 - 11:48 AM.


#7 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 860 posts

Posted 29 October 2018 - 04:29 PM

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.thedar...ected-cubemaps/ may be relevant.


Edited by VanishedOne, 29 October 2018 - 04:33 PM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#8 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 742 posts

Posted 29 October 2018 - 04:30 PM

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, 29 October 2018 - 04:39 PM.


#9 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 29 October 2018 - 04:56 PM

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.



#10 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5701 posts

Posted 30 October 2018 - 02:30 AM

Create your custom cubemap material then and use that.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#11 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 30 October 2018 - 02:45 AM

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.



#12 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 30 October 2018 - 03:14 AM

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.



#13 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 30 October 2018 - 03:38 AM

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.



#14 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 30 October 2018 - 11:13 AM

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.



#15 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 30 October 2018 - 02:25 PM

so I will pm Kingsal to see if his method might be useable.

I meant to Say Kvorning, as he did something similar in Lords and Legacy.



#16 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 30 October 2018 - 02:43 PM

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



#17 kingsal

kingsal

    Member

  • Member
  • PipPip
  • 355 posts

Posted 04 November 2018 - 01:18 PM

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.



#18 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 04 November 2018 - 02:02 PM

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, 04 November 2018 - 02:03 PM.


#19 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 04 November 2018 - 02:53 PM

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.



#20 kingsal

kingsal

    Member

  • Member
  • PipPip
  • 355 posts

Posted 04 November 2018 - 03:03 PM

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? 



#21 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9035 posts

Posted 04 November 2018 - 03:12 PM

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

http://wiki.thedarkm...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.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#22 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 742 posts

Posted 04 November 2018 - 08:30 PM

 

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.thedarkm...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, 04 November 2018 - 08:32 PM.

  • nbohr1more likes this

#23 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 05 November 2018 - 02:48 AM

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, 05 November 2018 - 04:25 AM.

  • HMart and VanishedOne like this

#24 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1644 posts

Posted 05 November 2018 - 08:14 AM

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, 05 November 2018 - 08:30 AM.

  • Bikerdude, HMart, nbohr1more and 1 other like this

#25 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 05 November 2018 - 08:38 AM

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.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users