If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
![]() |
|
|
#1 |
|
Crazy coder
|
I've published a new demo showing off the Interior Mapping technique, which basically is a pixel shader based technique for adding interiors to buildings. The buildings are still rendered as simple boxes. Rooms are represented as a cubemap and I'm using cubemap arrays in DX10.1 to select between different room layouts to avoid repeativeness.
![]() I was going to say "download at the usual place", but hey, it's not at the usual place, because my site has moved. It's now at www.humus.name, but is otherwise the same site as before. |
|
|
|
|
|
#2 |
|
Just wondering
Join Date: May 2002
Location: Germany
Posts: 1,716
|
So, 10.1-CM-arrays means no-go for Geforce-user?
But judging from the screenshot it looks like it could make large downtown sceneries much more believable. Any ideas if there are games going to be using it?
__________________
English is not my native tongue. Before being too nitpicky about my choice of words please consider the possiblity that I did not mean to say what you might have read into them and inquire before flaming.
|
|
|
|
|
|
#3 |
|
Senior Member
|
What would be the performance hit rendering those cube-maps in DX10.0?
For the report - it runs flawlessly for me (4870), just had to update the DX with June's Redistributable.
__________________
"Releasing a game in 2010 without AA is a completely foreign concept to me. If the technique you're using makes it impossible to use AA then you're using the wrong technique." -- Humus
|
|
|
|
|
|
#4 | ||
|
Crazy coder
|
Yeah.
Quote:
Quote:
Best would be if you had enough artwork for several different room types. If I had more time or were better at Photoshop I would have done that. That's not an option you have with DX10.0 though with this technique, unless you use several samplers and dynamic branching to select. |
||
|
|
|
|
|
#5 |
|
Just wondering
Join Date: May 2002
Location: Germany
Posts: 1,716
|
Then I'll give it a try as soon as my new Radeon arrives. But I'm having a hard time deciding between the ultra-cheap (~60 Euro) 3850 and the still-cheap but far more powerful HD4850.
Pity. It'd be a really nice thing for GTA-something or Max Payne III
__________________
English is not my native tongue. Before being too nitpicky about my choice of words please consider the possiblity that I did not mean to say what you might have read into them and inquire before flaming.
|
|
|
|
|
|
#6 | |
|
super willyjuice
|
Quote:
I'm sure it's an awesome demo, must remember to try it when I get hardware that can run it. |
|
|
|
|
|
|
#7 |
|
Crazy coder
|
Done. Thanks for reminding me.
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Aug 2004
Posts: 1,125
|
Nevermind
Last edited by NRP; 04-Aug-2008 at 05:40. |
|
|
|
|
|
#9 | |
|
Senior Member
|
Quote:
In that picture (easier to spot when you look at the large version of it in your web page) you can spot this minor issue quite a bit (second building on the right).
__________________
"Any idea worth a damn is already patented... twice" -Mfa |
|
|
|
|
|
|
#10 | |
|
Member
Join Date: Sep 2003
Location: Norway
Posts: 185
|
Quote:
Couldn't find a good picture and my memory is fuzzy so that might be one of the few normal windows pictured, so my nVengeance is tepid at best, but it was most noticable at night with dimmed lights behind curtains and such... ![]() Link to bigger: http://xbox360media.ign.com/xbox360/...2110819256.jpg Great effect though, I hope to see the more advanced type like Humus' demo in something soon, it's a clever use of available resources. |
|
|
|
|
|
|
#11 | |
|
Crazy coder
|
Quote:
Yep. I really liked the idea when I heard of it. Lots of games have just plain window textures with nothing inside, or just a flat image. Getting some depth to the interiors really does improve things a lot. |
|
|
|
|
|
|
#12 |
|
Member
Join Date: Dec 2004
Location: Melbourne, Australia
Posts: 233
|
Perhaps I'm missing something, but wouldn't this require far more processing power than just having real geometry for the room? A box for a room would be an extra 8 vertices - but you need many more pixel shader instructions for interior mapping. I imagine this would only yield a performance benefit if you had a lot of buildings with many windows, and they were all very far away (so they don't cover many pixels).
Although I guess it would save time for artists. |
|
|
|
|
|
#13 | |
|
Red-headed step child
Join Date: Jun 2004
Location: Guess ;)
Posts: 2,382
|
Quote:
The extra shader instructions are trivial compared to the rest...
__________________
"...twisting my words" |
|
|
|
|
|
|
#14 |
|
Crazy coder
|
The shader is 15 ALU instructions on RV670 / RV770. Half of that are things you would need in the geometry case too anyway if you want the same visual quality, like the lighting. Computing the cube texture coordinate is 7 ALU. Also, using real geometry you'll have to separate it into two passes, one for the interior and then another pass blending the exterior on top of it. This is inefficient since you won't get much help from z-rejection because the interior must be rendered first.
|
|
|
|
|
|
#15 | ||
|
Registered
Join Date: Aug 2008
Location: Netherlands
Posts: 8
|
Quote:
I cannot run your demo, though: I have an Nvidia DX10 card. It is a pitty that your technique requires DX10.1: this makes it much less applicable. Because my own technique runs well in shader model 2, it can be used on the XBox 360 and the Playstation 3, which is a great benefit. Your technique does seem to be a lot cheaper per pixel, though, which is nice. I am wondering to what extent your demo is pespectively correct, because a cubemap only takes into account ray direction and not ray origin. Can you explain how you handle that? Quote:
My full paper (published at Computer Graphics International 2008) with the performance comparison can be found here. |
||
|
|
|
|
|
#16 | |
|
Crazy coder
|
Quote:
Code:
+----------------Y----+ | / | | / | | / | | / | | / | | / | | / | | / | | / | +======X==============+ The final code after my optimizations is perhaps not so intuitive at what exactly it does: Code:
float2 f = frac(In.texCoord); // Entrance position into the room float4 pos = float4(f * float2(2.0, -2.0) - float2(1.0, -1.0), -1.0, cubeIndex); // Compute position where the ray intersects the cube float3 id = 1.0 / In.dir; float3 k = abs(id) - pos * id; float kMin = min(min(k.x, k.y), k.z); pos.xyz += kMin * In.dir; |
|
|
|
|
|
|
#17 | |
|
Registered
Join Date: Aug 2008
Location: Netherlands
Posts: 8
|
Quote:
|
|
|
|
|
|
|
#18 |
|
super willyjuice
|
I don't think Humus ever said his version is the best. He often makes demo's just to show people "hey look what's possible!" not "hey my way is the best and everyone else fails".
|
|
|
|
|
|
#19 | |
|
Registered
Join Date: Aug 2008
Location: Netherlands
Posts: 8
|
Quote:
|
|
|
|
|
|
|
#20 |
|
Crazy coder
|
You only need a single texture lookup. I think yours needs four.
|
|
|
|
|
|
#21 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#22 |
|
Registered
Join Date: Aug 2008
Location: Netherlands
Posts: 8
|
That is true, but that could also be achieved by using an if-statement and only looking up in the right texture, because the values from the other three textures are ignored anyway. I never got around to trying how much performance would actually be gained by that, though, but I guess you are right that your version is indeed faster because of that.
Euhm, what are you refering to? I guess I could use one? |
|
|
|
|
|
#23 |
|
Senior Member
|
You say a big part of the speed advantage over the polygonal version is the fact it can be done in a single draw call ... with a texture atlas (with some pixel shader magic to handle the tiling) that advantage would not be there.
In the end I'm doubtful that raycasting inside the pixel shader is going to beat rasterization for something which adds so few polygons, theoretically you are doing more work (assuming efficient occlusion culling). Also you put yourself in the position of needing to add new code for the shading when you use shadow buffers (and anything which needs the correct Z value in the Z-buffer is right out). The "oh no, scary high polygon counts" is something we need to get away from now it's all unified. Last edited by MfA; 10-Aug-2008 at 11:19. |
|
|
|
|
|
#24 | ||||
|
Crazy coder
|
Quote:
Quote:
Quote:
Quote:
Close up it's probably going to be a bit faster to just rasterize with real geometry. In the medium distance LOD interior mapping would likely be the winner, and in the far LOD it's probably enough to just stick to a flat texture and only keep the lights on/off switch. |
||||
|
|
|
|
|
#25 |
|
Registered
Join Date: Aug 2008
Location: Netherlands
Posts: 8
|
What do you mean with "the gradient version"? Is that some situation in which dynamic branching has a certain performance?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|