Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Released] Interior Mapping

Discussion in 'Assets and Asset Store' started by aubergine, Jan 11, 2012.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    This shader uses cubemaps to create the illusion of windowed offices or interior spaces, without the need for interior mesh information. This pack is optimized for Windows/OSX builds, but also works on Android and iOS with GL2.0.

    ASSETSTORE LINK

    EDIT: Updated to v1.1 with support to 2 cubemaps per building for variation.

     
    Last edited: Feb 12, 2015
  2. alexfeature

    alexfeature

    Joined:
    Apr 1, 2010
    Posts:
    132
    Nice work.
     
  3. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    That's extra cute ! :D
     
  4. iisjreg

    iisjreg

    Joined:
    Mar 25, 2011
    Posts:
    101
    Purchased! Thanks.
    But my question still stands (I'm no shader programmer): Could you add more cubemaps to the shader to pick a random one, let's say a maximum of 3 maybe?
     
  5. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Hey thanks for purchase :)

    If you are not planning to use it on mobile, it is possible.

    I may put it there in a seperate shader in the next update to be used in heavy-duty platforms rather than mobile gadgets.
     
  6. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Okay, added support for 2 cubemaps in a seperate shader and submitted to the store now.
    This will still work on mobile and gives enough variation with a seperate random function.

    EDIT: If you still insist on 3 cubemaps, it wont work on mobile anymore.
     
  7. iisjreg

    iisjreg

    Joined:
    Mar 25, 2011
    Posts:
    101
    Wow, thank you. No, three maps was just a random number pulled out of thin air.
    Thank you very much!
     
  8. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    Wow, that is a really cool effect!
     
  9. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    The update is confirmed now. You can download the v1.1 from the store.
     
  10. d.eisenga

    d.eisenga

    Joined:
    Sep 14, 2011
    Posts:
    43
    This is really cool! The repetition is still quite obvious though. Is there a limit to how many cubemaps a pc/mac-only version could have, if you were to include such a aversion?
     
  11. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    If pc/mac and if sm3.0 is not a problem, than it can be hundreds of them but obviously it would be very unnecessary and really beats the purpose of this shader.

    While planning this shader, i was planning to put detailed base floor and put the cube on top of the base floor with the interiormap to give it extra details.

    That is also the purpose of the original paper which was shown in CGI 2008 Istanbul/Turkey
    Although the technique i use is completely different than the original paper here, the purpose remains same.
     
    Last edited: Jan 13, 2012
  12. tzvier

    tzvier

    Joined:
    May 20, 2010
    Posts:
    355
    Aubergine, you've done things with shaders that I never thought possible. I am honestly anxious for the day I can get around to using some of the cool stuff you've produced.
     
  13. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Hey, thanks for the kind words. I hope my accountant will appreciate the same way at the end of the month :p
     
  14. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
  15. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Sorry to inform you people, the introduction period is over and the price is fixed to 25$
     
  16. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Another bump.
     
  17. xalener

    xalener

    Joined:
    Nov 28, 2011
    Posts:
    20
    This effect was awesome in Halo 3: ODST. Great job, man!
     
  18. S0ULART

    S0ULART

    Joined:
    Jun 14, 2011
    Posts:
    131
    @xalener:
    Didnt play the game can you show an example? Im really interested to see the effect by real games in use:)
     
  19. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    I dont think this was used in Halo 3, although im not sure, i never played it.

    Anyhow, this effect is a must for city environments if you want to give proper depth feeling to your low poly buildings. And for night time scenes, turn some lights on and off in your building and add a glow/bloom image effect for the camera and watch the beautiful scene.
     
  20. xalener

    xalener

    Joined:
    Nov 28, 2011
    Posts:
    20
    It wasn't in Halo 3. It was in Halo 3: ODST. It was kinda an expansion pack with minoir engine updates. The game is based in a city (New Mombasa) and it made extensive use of this effect. It even works ok on curved windows in the game.

    here's some pics:

    http://www.bungie.net/Online/Halo3UserContentDetails.aspx?h3fileid=102104436

    http://www.bungie.net/Online/Halo3UserContentDetails.aspx?h3fileid=102104490

    There are a few issues with it however:
    http://www.bungie.net/Online/Halo3UserContentDetails.aspx?h3fileid=102104521

    I'm not sure if it's the method itself that results in issues like the one pictured above, or their specific implementation, but it's not nearly bad enough to be a distraction. Especially in a shooter.
     
    Last edited: Mar 16, 2012
  21. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Hello people, the price for this pack is reduced to 15$ and this pack is now also a part of my shaders pack.
     
  22. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    This pack is compatible with Unity 4.
     
  23. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    On you website you are saying:
    Is there any way to deal with that?

    I have some applications in mind that need all 4sides of an building with this effect shader.
     
  24. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    It is possible, but then you cant use random lighting of individual apartment flats.
    Cant you just hide one side? Or make it static view?

    By hiding, i mean make 1 building with 4 different cubes with all static faces looking at each other hidden. Thus you get all 4 sides of 1 huge building.
     
  25. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Maybe its possible to just replace the one side that not behaving to replace it with another mesh rendering with the same shader.
    Or make a second pass (drawcall) to render the 4. side. (im no shader expert)
     
  26. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Yes, something like that as i mentioned, you can mirror 3 more cubes and put them side by side to cover all 4 static edges to be in the center so they wont be visible but the 4 blocks will look like 1 block anyways.
     
  27. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    Hey Aubergine,

    Would it be possible to have a version of the shader that will take a unity default plane and make it a single window. I want to be able to add just one window at a specific spot in my scene. I tried editing the shader myself but only got mangled results. Thanks!
     
  28. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    How do you mean, i dont quite understand. Do you want 1 specific window in a specific place on the surface of a plane object? Or do you want a single window on the whole surface of a plane object?
     
  29. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    $example.png

    A single window on the whole surface of a plane. In my attached image I would like to make each of those planes a single window.
     
  30. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Well, the point of this was to make them work on cubes rather than individual planes.
    If you want it to work on individual plane objects(they must be vertical not horizontal to floor) change the below lines in one of the shaders:

    //Everything in World Space
    float3 tan0 = mul(float3x3(_Object2World), float3(v.tangent.x, 0, -v.tangent.z));
    float3 tan1 = mul(float3x3(_Object2World), float3(-v.tangent.z, 0, v.tangent.x));

    to;

    And if you want only 1 window, try to reduce the "Amount of Windows" variable down to 0.1

    Again, due to purposes of this shader, everything is calculated in World space including uvs, so you may have to offset the objects in World coordinates to catch the right settings.

    If you need any help in editing the shader, let me know and i will send you the whole new shader. But i really dont want to update the package for this now.

    EDIT: Also i should mention that unity provided plane object has too many vertices and not good for the purpose of this shader. You should make your own plane object with 4 vertices alone and dont forget to calculate tangents when importing it.
     
  31. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Long time no update here. So, i decided to add some more variations.
    I will include a surface shader variation so that your buildings will be able to cast/recieve shadows and get effected by lights.

    Although this is overkill as the shaders already provide enough lighting, some people might want to use it.

    I will submit new update sometime around next week.
     
  32. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    New update is live in the store, folder structure and shader names changed.
    So, delete the old package before updating to new one.

    EDIT: The new update is accepted but i noticed demo files are missing and broken. I resubmitted again.
    Sorry for the inconvenience.
     
    Last edited: Mar 12, 2014
  33. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Where is the web demo? The link in first page doesn't work.
     
  34. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Sorry i have removed the webdemos. My website recently crashed and im trying to fix it.

    Meanwhile, there is a new update again. This is a minor update, to fix some demo files.
     
  35. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  36. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    You mean for the windows? Or the whole building?

    If you mean for the windows, its unnecessary to add a secondary cubemap.
    Just design your interior cubemaps with the reflection added on top with some photoshop operation.

    If you dont like the above idea and must really use a seperate cubemap, let me know which one of the shaders you use and ill add it for you. But this is not a cost effective way.
     
  37. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    For windows, or the glossy part I specify in the texture. I want to reflect the sky so can I design the interior cubemaps with reflection?
     
  38. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    The reflection will be visible only from a distance while looking at the whole building. So, you blend a sky cube face texture and interior face texture through photoshop (this will need some trial and error) into 1 texture and make a cubemap out of these.
    Then when you look at the building from a distance, the sky image will be visible and when you come closer, the interior will be visible.
     
  39. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  40. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Sorry we have no access to youtube at the moment, government prohibited access.
    Can you post an image?
     
  41. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    $2014-04-11 23_50_42-Assassins Creed 3 – Windows _ Simon schreibt. - Maxthon Cloud Browser 4.1.2..jp

    Each room is their own map.

    PS. Not sure if the image is showing up, it's not showing on mine but the forum has attached it
     
    Last edited: Apr 11, 2014
  42. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Image is visible.
    I understand you want 1 room in 1 floor and same room should be visible through several windows right?
    All you have to do is set the tiling to 1 and use a window texture which is tiled in photoshop but not in shader. Instead of 1 window, use 2-3 and you will get the same effect.
    It will look tiled with the help of tiled window texture but it will be 1 room in every floor indeed.

    Or have i understood wrong?
     
  43. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Here is one very nice tutorial on creating buildings in 3d Max and a city block in general.
    This works wonders together with my shader. (Building generation tutorials start from 19th Lesson.)

    Even its 3dMax specific, most techniques apply to other 3d packages as well.
     
  44. Ducahl

    Ducahl

    Joined:
    Dec 9, 2014
    Posts:
    20
    This shader is truly great!. I just want to start with that. :)

    I am having some issues I'd like to ask for your feedback on if you don't mind aubergine.

    1.) Transferring the mesh from a 3d package I seem to get mixed results. Sometimes the textures (interior mapping) are stretched, sometimes squished. I can't seem to figure out a pattern. I try keeping it consistent, hence is why I am trying to figure out a pattern so I can adjust it, maybe you have a quick solution?

    2.) Combining yields mixed results. Lets say I have a building with multiple windows facing several directions, not just a box building. Floors have different sizes, and angles. I am able to place windows that work with the shader, but once I combine them, they stretch. For performance purposes I need these windows to combine into one mesh preferably.

    3.) Like one of the users posted previously, I think a reflective channel would be nice to have for higher end games, like pc, and consoles (ps4, xbone) . I tried blending in a sky texture into the cubemaps and it just doesnt look as good as glass should. My solution for now is I put a floating piece of geo over my windows and assigned a transparent reflective shader to it. It looks great but I think if it could be integrated within the interior mapping shader it would be even more efficient.

    Thank you for any help you may be able to provide.
     
  45. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    1- That depends on your model, assuming you are just using cube like shapes for the parts of the building where you will apply the interior mapping, you just should uv map those parts as cube mapped (in 3d max or whatever your software is)
    Although ive never seen such an issue, can you send me a small example model to test with?

    2- You can use cylindrical objects as well it doesnt have to be a cube exactly, but that will obviously cause some deformation at some points. The best i can advice is to use planar mapping on each face that a window will be seen.
    And again i never experienced such issues, can you post some pictures or stuff so i can understand what you mean exactly.

    3- Okay, i will add cubemap reflections for the whole building face where windows are, in the next update as a seperate shader.
     
  46. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Well, i did prepare a variation with sky reflections on the windows(it is not per room, it is per side of the building as its how it should be). But i dont want to update the package in the assetstore just for this.
    The addition of sky reflections surely add some extra beauty, but it does sort of break the purpose of varied room lightings as it is supposed to be mostly used in night situations. As seen in the picture, i over did the light rooms lighting to make it more obvious in the picture.
    But anyways here it is.
    Whoever wants it, reach me on my email with the invoice number, and i will send you the custom shader.

    interior1.jpg
     
  47. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Here is a short video, applied the shader to Bumstrums deserted skyscrappers pack from the assetstore.

     
  48. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Highly interested in the sky-reflection-variant!
    Is it compatible with TimeOfDay-plugin?
    A shaderforge version would be awesome.

    Webplayer example please! :)
     
    Last edited: Feb 12, 2015
  49. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    I dont know how TimeOfDay plugin works. The reflection is just another cubemap there.
    But that is not a good cubemap to go, as seen in the picture, the top windows reflect the clouds in the skybox but the bottom windows are over tinted because the bottom of the skybox is foggy white.
    It is better to render custom cubemaps with the sky and the buildings, so the cubemap shows all the sky, the buildings and the ground.
     
  50. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I see.
    Anyway - Webplayer?