Interior Mapping

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Interior Mapping

Postby Oogst » Tue Mar 27, 2007 9:08 am

Update 29th September 2007:
The newest images can be found here:
http://www.ogre3d.org/phpBB2/viewtopic. ... 311#250311




Question: is this technique indeed new?

I have come up with a nice new technique to suggest interiors in buildings: interior mapping. What the technique does, is smartly read from a ceiling-texture to show a ceiling behind windows. Here are some images to show what I mean. This is a standard box, without any internal planes. It has a diffuse texture, cubemap reflections and interior mapping.

Image

Image

Image

Latest demo can be found further in this topic.

The technique requires one extra dependent read in the pixel shader and can be extended to also do interior walls and floors (right now the ceiling texture is just used as the floor as well). Doing walls, ceilings and floors would require four dependent texture reads, though, so that is more expensive. I think this technique will be especially interesting for shooters in urban areas, where most choose to make the windows simply 100% reflective. This technique can suggest a lot more depth to the graphics.

Now I have never seen this technique used before, so I think I might have come up with something New, Cool and Fresh, but I do not know whether that is actually true. So I hope you folks can tell me whether this ahs been done before.

The idea comes from an effect a friend of mine, Ralph Rademakers, once noted in a game: the texture mapping was broken due to a bug and what he saw suggested interiors. He asked me whether it would be possible to do something like that on purpose and I came up with this. The math is really simple: the ray from camera to pixel is traced further in object space to ceilings on fixed heights. The height for the next ceiling is found using the floor()-function, so this allows an infinite number of ceilings at fixed distances without extra costs for the number of ceilings.

If this has not been done before, then I will experiment further with this technique, trying optimisations and further uses of this technique.
Last edited by Oogst on Sun Feb 14, 2016 10:35 am, edited 8 times in total.
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Postby Vectrex » Tue Mar 27, 2007 11:51 am

that's really cool, runs nicely too.
0 x

Thamas
Gnoblar
Posts: 4
Joined: Tue Jul 04, 2006 1:49 pm

Postby Thamas » Tue Mar 27, 2007 12:25 pm

Cool technique. :)

I do think the look is a bit messy: I'm not entirely sure I would have understood what I was looking at if you hadn' told me. (I will test it on an unsuspecting subject tonight; see what he thinks ;). ) A better texture would probably go a long way, but you might also consider heavy fog inside the building. (If I glark correctly how you're calculating things, this would be trivial to add.)
0 x

User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England

Postby Chris Jones » Tue Mar 27, 2007 1:44 pm

i like the effect, adds more depth to the building. the 1 thing i dont like about games is when you have a 3d building with a really flat texture on it which includes all the windows/doors etc.
0 x

Ajare
Goblin
Posts: 282
Joined: Sat May 14, 2005 9:20 pm

Re: Interior mapping

Postby Ajare » Tue Mar 27, 2007 2:42 pm

Oogst wrote:Question: is this technique indeed new?

It might well be. Quick, call it Oogst Mapping before 'Interior Mapping' catches on!

Giving each floor its own ceiling would be worth it IMO. Can you give us any shots of this?
0 x

vimes
Gnoblar
Posts: 15
Joined: Fri May 19, 2006 5:00 am

Postby vimes » Tue Mar 27, 2007 4:39 pm

It's an interesting feature but it might get better if you
1 - create a second texture for the floor so that it looks less confusing
2 - you activate this effect only when the camera is in a certain range of the building ( better activate it progressively if it's possible)
I would have had looked into it myself, but I'm busy trying to get the exampleapplication working :lol:
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Postby sinbad » Tue Mar 27, 2007 5:37 pm

That's a really nice idea, haven't heard of it before.
0 x

User avatar
Aladrin
Orc
Posts: 465
Joined: Fri Mar 10, 2006 10:22 pm

Postby Aladrin » Tue Mar 27, 2007 6:06 pm

This is really good looking. You aren't gonna copyright the technique and make us all hate you, are you? :D

This is definitely one of the things I want to play with once I get off my fat butt and get coding.
0 x

User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Postby SpannerMan » Tue Mar 27, 2007 7:03 pm

Thats really cool, good job. Is it easy enough to configure a little, like say for example to:

a) change the amount of lighting on each level's ceiling/floor texture? For example a level may have its lights turned off.
a) use multiple textures so the different levels of the building appear to have different ceilings / floors?
0 x

User avatar
Aladrin
Orc
Posts: 465
Joined: Fri Mar 10, 2006 10:22 pm

Postby Aladrin » Tue Mar 27, 2007 7:12 pm

Unless I am badly mistaken, There is actually only1 ceiling, it just appears to have multiple. You can't vary the lights and ceilings on each floor because they don't actually exist.
0 x

Prezadent
Gnoblar
Posts: 18
Joined: Sat Feb 10, 2007 11:59 pm

Postby Prezadent » Tue Mar 27, 2007 7:26 pm

0 x

jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Postby jjp » Tue Mar 27, 2007 7:32 pm

Cool trick :) However: I think it might in practice not be that more expensive to actually put some planes inside the building and have "real" floors and ceilings. But I wonder if this technique has other interesting uses?
Last edited by jjp on Tue Mar 27, 2007 7:33 pm, edited 1 time in total.
0 x
Enough is never enough.

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
Contact:

Postby Kencho » Tue Mar 27, 2007 7:33 pm

Looks interesting... Modeling large cities might make a good use of this. You can do very large batches in terms of vertex count, and still have a nice depth and detail on the buildings!
0 x
Image

Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Postby Oogst » Tue Mar 27, 2007 8:54 pm

I went a bit further with this, now that it seems to be indeed a new technique. So far I think that creating good textures for this is pretty difficult and I will have to put more effort into that to get it to actually look good. These buildings are almost all windows, which is quite unnatural and also emphasizes the Interior Maps too much, I think, showing their seems and horizon.

I put a new version online, this time with several different materials to show a bit more of how it works, and a floor added to it. The result looks like this:

Image

You can try this demo version 2 here: interior mapping demo v02 (ZIP, 3,7mb)

Thamas wrote:...you might also consider heavy fog inside the building. (If I glark correctly how you're calculating things, this would be trivial to add.)

Fog would seem odd, I think, but I might put a limit on the distance at which the map is shown and show some dark grey from a certain distance instead, suggesting a wall inside the building.
Aladrin wrote:...You aren't gonna copyright the technique and make us all hate you, are you? :D...

Nope. I intend to write a short paper about it instead, just for the fun of it.
SpannerMan wrote:...Is it easy enough to configure a little, like say for example to:

a) change the amount of lighting on each level's ceiling/floor texture? For example a level may have its lights turned off.
a) use multiple textures so the different levels of the building appear to have different ceilings / floors?

Changing the lighting per floor is actually not very difficult, because I can just calculate some random lighting value from the height of the floor. That way a specific floor will always get the same lighting and the next floor will be darker or lighter.

Multiple textures could be done as well, but the technique is pretty expensive as it is, so I do not think it would be worth it to do that. It might be interesting to put several floors in one texture, though, and do some texture coordinate jiggling to switch them per floor. Might work for little price that way, as I am already doing dependent reads anyway. I wonder how that would look, though, as a repeating pattern in switching floor textures would definitely look very ugly and I am not sure I could make it random. And even random the repeating of two is probably more ugly than of one.

Nope, that one is just about reflections in windows. Reflections are in my demo and images, though, as an added effect, but the Interior Mapping I am talking about here is the ceilings inside the building.
jjp wrote:...I think it might in practice not be that more expensive to actually put some planes inside the building and have "real" floors and ceilings. But I wonder if this technique has other interesting uses?

I think the price of the effect greatly depends on the texture resolution, as dependent reads like this will kill the texture cache, I suppose. Doing reads close to previous reads is important for performance. So experimenting with texture resolution might help performance.

As for putting floors there: this technique is especially interesting for high buildings with lots of floors. For polygons, that would mean lots of polygons, while this technique still costs the exact same performance. Also, putting planes there requires a lot of extra textured planes that need to be blended with reflecting windows in front of them. Alpha blending is pretty expensive to do. All in all, I am hoping that this is more efficient than putting actual planes there, but I will have to test that to be sure, of course.
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance

vimes
Gnoblar
Posts: 15
Joined: Fri May 19, 2006 5:00 am

Postby vimes » Tue Mar 27, 2007 9:46 pm

It's really strange : up close and with an angle the result is really convincing, but as soon as you're a bit far (i.e. when you can see the whole building), it seems wrong, somehow... Maybe it is because there is no far boundary on the and there is no wall inside, I'm not sure.

But anyway, the effect as it is now might be useful to create Escher-ish building or surrealist landscape, for those who wants to use in a unrealistic/unbelievable fashion.
0 x

big_o
Goblin
Posts: 279
Joined: Sun Feb 19, 2006 1:08 am

Postby big_o » Tue Mar 27, 2007 9:56 pm

It looks slightly wrong somehow, but it still looks pretty cool.
0 x

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Postby Praetor » Tue Mar 27, 2007 10:48 pm

http://www.shunya.net/Pictures/South%20 ... craper.jpg
http://www.sjphoto.com/hk-web/images/HK-skyscraper.jpg
http://sweb.cz/tofu007/Skyscraper.Lovely.jpg

You'll notice that indeed, skyscrapers that are mostly glass are designed to have their outer surfaces almost completely reflective. Draw you attention, however, to the second one. I believe you can just make out some details through those windows.

Looking at some other non-skyscraper building pictures, they are designed so you can see a bit more inside. Looking at your demo pic and then actual photos I'm not convinced you technique is flawed. It seems a combination of window size, window clutter and reflectivity may make all the difference. A good texture artist could create interior and window textures which combine to make a very convincing effect.

Keep going, I think you have something! Don't write just a short paper for fun, write a long one for fun and see what you get out of it.
0 x

User avatar
Aladrin
Orc
Posts: 465
Joined: Fri Mar 10, 2006 10:22 pm

Postby Aladrin » Tue Mar 27, 2007 10:56 pm

Oogst wrote:
Aladrin wrote:...You aren't gonna copyright the technique and make us all hate you, are you? :D...

Nope. I intend to write a short paper about it instead, just for the fun of it.


I was kidding of course ;) It would have been perfectly within your rights to license this out, instead. I'm glad you're not, of course. It's amazing.
0 x

User avatar
jomunoz
Goblin
Posts: 228
Joined: Wed Apr 13, 2005 5:07 pm
Location: Medellin - Colombia

Postby jomunoz » Wed Mar 28, 2007 2:59 pm

It's really cool. Doesn't give the impresion of being a cube at all.

Nice idea.


PS: The only thing i notice is that the room looks like having infinite space, i mean it doesn't have a right or left wall (depending on how you look at it.)
0 x

Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Postby Oogst » Sun Apr 01, 2007 1:19 pm

Because of the problems with the planes going to infinity, I have been working on combining several planes to get rooms instead of infinite floors. Currently the rooms do not have textures, which looks like this:

Image
(This is still just a cube made of 12 triangles! These planes are not in actual geometry!)

I hope to have a version with some form of texturing this evening and I will put a new executable online then as well.
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance

User avatar
Aladrin
Orc
Posts: 465
Joined: Fri Mar 10, 2006 10:22 pm

Postby Aladrin » Sun Apr 01, 2007 1:30 pm

Oogst wrote:(This is still just a cube made of 12 triangles! These planes are not in actual geometry!)


I was like "doesn't this kind of kill the original concept" but then you went and explained and made it 10x cooler again ;)

I'm really, really looking forward to seeing that textured and shown off like the first post. Simply awesome, man.
0 x

User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Postby ahmedali » Sun Apr 01, 2007 5:46 pm

I think the technique used in this project is called Camera Mapping, commonly used in programs like 3dsmax/maya to map textures/pictures to 3d objects based on camera position and angle. If generalised, there may be many other uses too.
0 x

Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Postby Oogst » Sun Apr 01, 2007 6:14 pm

I will have a new version up and running in a moment. In the meanwhile: I am trying to get my cube reflections right, but somehow they get mixed up badly. Can someone tell me what I am doing wrong with them?

This is the topic with the question:

http://www.ogre3d.org/phpBB2/viewtopic.php?p=214446
Last edited by Oogst on Sat Apr 07, 2007 1:06 pm, edited 1 time in total.
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance

Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Postby Oogst » Sun Apr 01, 2007 6:30 pm

ahmedali wrote:I think the technique used in this project is called Camera Mapping, commonly used in programs like 3dsmax/maya to map textures/pictures to 3d objects based on camera position and angle. If generalised, there may be many other uses too.

As far as I know, camera mapping is something very different from what I am doing here. I do not know what it means in MAYA, but in 3D Studio MAX, camera mapping has hardly anything to do with interior mapping.
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance

Oogst
OGRE Expert User
OGRE Expert User
Posts: 1034
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
Contact:

Postby Oogst » Sun Apr 01, 2007 7:08 pm

Woopsie, here the thing is with more room-like interiors! This is all just a 12-triangle box, so these planes still only exist in the shader math. :D

Rooms without textures:

Image

Textures applied to the ceilings in the rooms:

Image

Image

One texture applied to all the walls in the rooms:

Image

Image

Funky effect on a sphere:

Image

A lot of different settings, including the possibility to shift the floors around, rotate the buildings and change the mesh, are now in the executable:

Image

Download the demo (source included): Interior Mapping v4 (3,9mb, ZIP)

The change since the first version of this shader is that I now not only check for horizontal planes, but also for vertical planes. This solves the problem with the planes going into infinity and looks quite nice, I think. :) It took me quite some effort to cramp everything in the 64 instructions that shader 2 gives me, though, but now I have one diffuse texture, one cube texture and one interior texture and lighting on the interior and that all works nicely, I think.

I think my next step will be to try and make a real street with buildings with interior mapping. I also still need to make a version with triangles instead of my shader to check the difference in performance. My shader has become quite complex, so I am not sure who will win...
0 x
blog.oogst3d.net: my dev blog and portfolio
Ronimo Games: my game dev company
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/PS3/PS4)
Swords & Soldiers: side-scrolling RTS (PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance


Return to “Showcase”

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests