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!
Post Reply
User avatar
odyeiop
Halfling
Posts: 97
Joined: Fri Dec 22, 2006 4:56 am
Location: stoney creek

Post by odyeiop »

ah.. now that is really neat =) Great work!
I'm Immortal as you are Divine.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Wow! That looks completely as if it was really modelled! Its all done in shaders with only one cube, right?
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
x 3
Contact:

Post by Praetor »

Very much cooler. Urban simulations can really use this to get more detail. The inclusion of rooms really helps. You can change the number of rooms, right? So, for instance a whole building could be treated as one room?
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

Praetor wrote:Very much cooler. Urban simulations can really use this to get more detail. The inclusion of rooms really helps. You can change the number of rooms, right? So, for instance a whole building could be treated as one room?
The frequencies of the walls along different axes can be changed. So maybe the frequency must be set to the dimensions of the box, 0 or 1 or something like that to get just one room.
Shadow007
Gremlin
Posts: 185
Joined: Sat May 07, 2005 3:27 pm

One additional feature ?

Post by Shadow007 »

Wow, I really like it.
I've got one question and one suggestion though :

Question : I can't find the definition of the "step" function that you use in the shader (didn't download the cg toolkit though). Could you please explain what it does ?

Suggestion :
Would it be possible to use some kind of texture-atlas for the ceiling/floor/Walls textures so that some 'randomized' variety is added.
I'd guess you could use some kind of hash from height/walls to have a random but persistent pattern.
This could allow for example to have lit/unlit rooms on a facade, or to break the uniform look.
I'd guess using 4 distinct sub-textures (using the last 2 bits of a hash) would add quite a lot of variety...
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Post by Oogst »

nikki wrote:Wow! That looks completely as if it was really modelled! Its all done in shaders with only one cube, right?
Yups!
Shadow007 wrote:... Question : I can't find the definition of the "step" function that you use in the shader (didn't download the cg toolkit though). Could you please explain what it does ?
From the Cg user's manual:

Code: Select all

step(a, x)
   0 if x < a;
   1 if x >= a.
Shadow007 wrote:Suggestion :
Would it be possible to use some kind of texture-atlas for the ceiling/floor/Walls textures so that some 'randomized' variety is added.
I'd guess you could use some kind of hash from height/walls to have a random but persistent pattern.
This could allow for example to have lit/unlit rooms on a facade, or to break the uniform look.
I'd guess using 4 distinct sub-textures (using the last 2 bits of a hash) would add quite a lot of variety...
It would be possible, but in the full version I do not have any instructions left to do the math. I will give it a try in a simpler version, though, but I think the added effect will not be large. Another solution for the light/dark thing would be to just create a lightness-function that depends on the position of a room.
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

My shader has become quite complex, so I am not sure who will win...
But the heavy work is all in the pixel shader, so if you're using early z-out your method will have constant complexity with respect to the number of houses... well almost. That's pretty good, right?

In fact, this is like faking a geometry shader on dx9!
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Post by Oogst »

beaugard wrote:...
But the heavy work is all in the pixel shader, so if you're using early z-out your method will have constant complexity with respect to the number of houses... well almost. That's pretty good, right?

In fact, this is like faking a geometry shader on dx9!
I had not thought of it like that yet, but what is "early z-out"? Do you mean that I should make sure things are rendered close-objects first (which Ogre does by default)? Or is there something specific that I will have to turn on?
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Early z-out is exactly that. Once you write a pixel in the depth buffer, further pixels (higher z) won't be drawn. This way you avoid writing to the same pixel twice.
Ogre does that at an object-level. What I think he means is to do it in a wall-level, rendering the closest walls first.
Image
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 7
Contact:

Post by haffax »

Ogre doesn't do this at object level. Or rather it only does it for objects with z-test/writing turned off and then in reversed order..

Though a course grained sorting could probably be achieved cheaply in the OctreeSM when making the order of the node traversal camera dependent. I've thought about it, but so far didn't try it.

And I guess with the all new SceneManagers in Shoggoth we will see this at work too.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I know Ogre does for the transparent objects, but I'd have bet it also does for the opaque ones! :| Good to know...
Image
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

I meant like in this post (there are quite a few more, not sure if this is the best one).

http://www.ogre3d.org/phpBB2/viewtopic. ... early+zout

found another one:

http://www.ogre3d.org/phpBB2/viewtopic. ... &start=113

Since first pass of all materials are rendered before second pass, the z-buffer will be ready by the time your expensive shader is called, and only visible fragments will be processed. Just remember to use exactly the same calculations in the vertex programs of both passes, or there will be z fighting.
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Post by Oogst »

Hmm, interesting, that is definitely worth to give a try! As I understand it, I can use early z-out on just these objects and let all other objects be rendered normally. That sounds pretty efficient! I already knew the technology, but I did not know Ogre rendered per pass instead of per object.
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

Yes, this is how I use it too. On objects with inexpensive fragment shaders (or expensive vertex shaders, I suppose...) I have only one pass, whilst on objects with complicated fragment shaders I have two, the first with colour_write off.
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

I already knew the technology, but I did not know Ogre rendered per pass instead of per object.
Yeah, it took me a while until I happened to stumble upon this in the forums - not so easy to figure out from API docs and first principles :). Actually it should be in the manual (as an example or something) just because it is such a nice trick.
free_FROZ
Halfling
Posts: 51
Joined: Thu Feb 09, 2006 1:01 am

Post by free_FROZ »

If you figure out how to add random office supplies and furniture in there, you'd really have something.
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

free_FROZ wrote:If you figure out how to add random office supplies and furniture in there, you'd really have something.
xD

Oogst: interesting technique :wink:
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

free_FROZ wrote:If you figure out how to add random office supplies and furniture in there, you'd really have something.
ROFL.
User avatar
Virion
Halfling
Posts: 85
Joined: Mon Jul 24, 2006 11:06 am
Location: Malaysia
x 2

Post by Virion »

Good job. It is really nice. :D
Shadow007
Gremlin
Posts: 185
Joined: Sat May 07, 2005 3:27 pm

Other possibility ...

Post by Shadow007 »

Wouldn't it be possible to use a cubemap for the inside texture ? This could allow with one single pass to adress the floor/ceiling/walls problem would'nt it ?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

very nice idea :) If this technique is used with good textures, and a blend of reflectivity/transparency mimicing real buildings you could achieve very convincing results
You're certainly unto something. I saw something like this technique (virtual geometry) before to map a pool bottom to a plane in a water simulation, but for buildings this is new afaik.
Prezadent
Gnoblar
Posts: 18
Joined: Sat Feb 10, 2007 11:59 pm

Post by Prezadent »

Its a mirror of a hidden environment cube. Or it could be.
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

I think Crackdown is doing something like this for building interiors. Most of the windows in Crackdown let you see slightly into the buildings and they are all mapped with similar style textures (office buildings you can see the floor and ceiling and they fade to darkness as it gets deeper into the building.

I doubt that Crackdown modeled even simple interior geometry for the buildings and was wondering what kind of trickery they used.

It's possible they didn't do this technique though, and I could be rambling. Regardless, it's a very nice illusion - great work.
User avatar
jomunoz
Goblin
Posts: 228
Joined: Wed Apr 13, 2005 5:07 pm
Location: Medellin - Colombia

Post by jomunoz »

:shock: That is so cool...
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Post by Oogst »

I tried the early z-out thing and who, that really kicked some framerate butt! For a scene with a lot of cubes behind each other, the framerate went from 58 tot 110 fps. :shock: Funny thing is that the exact boost depends on which object is in front. If the object I created first in 3D Studio MAX is in front, then there is hardly any boost. If one of the last objects is in front, then the boost is a almost a factor 2. This only makes sense, of course, but it is nice to see this thing work as expected.

I still did not get my cube mapping right, by the way, so I opened a topic about it here:

http://www.ogre3d.org/phpBB2/viewtopic.php?p=214446
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
Post Reply