Interior Mapping
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
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.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?
-
- Gremlin
- Posts: 185
- Joined: Sat May 07, 2005 3:27 pm
One additional feature ?
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...
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...
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
Yups!nikki wrote:Wow! That looks completely as if it was really modelled! Its all done in shaders with only one cube, right?
From the Cg user's manual: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 ?
Code: Select all
step(a, x)
0 if x < a;
1 if x >= a.
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.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...
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
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
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
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?My shader has become quite complex, so I am not sure who will win...
In fact, this is like faking a geometry shader on dx9!
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
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?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!
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
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
- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
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.
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.
- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
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.
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.
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
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
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
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
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.I already knew the technology, but I did not know Ogre rendered per pass instead of per object.
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
xDfree_FROZ wrote:If you figure out how to add random office supplies and furniture in there, you'd really have something.
Oogst: interesting technique
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
-
- Gremlin
- Posts: 185
- Joined: Sat May 07, 2005 3:27 pm
Other possibility ...
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 ?
- :wumpus:
- OGRE Retired Team Member
- Posts: 3067
- Joined: Tue Feb 10, 2004 12:53 pm
- Location: The Netherlands
- x 1
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.
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.
- Falagard
- OGRE Retired Moderator
- Posts: 2060
- Joined: Thu Feb 26, 2004 12:11 am
- Location: Toronto, Canada
- x 3
- Contact:
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.
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.
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
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. 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
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
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