Search Unity

VR work in progress (Baked Textures)

Discussion in 'Made With Unity' started by alejobrainz, Sep 10, 2005.

  1. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Hello,

    I downloaded the unity trial yesterday and this are my first results:

    http://bogota.zerofractal.com/alejandro.gonzalez/VR Demo/stand-alone/cynergi.zip

    In order to achieve a nice lighting we are testing texture baking. It produces huge files and takes up a lot of ram, but for arhcitecture is well worth it. Comments and crtis are welcome.

    I have some question regarding unity:

    - Is there a way to embed video clips, or to map a video onto a texture somehow?
    - Is there a way to turn on Antialiasing?
    - i had some issues of objects flickering behind transparent glasses. Is this normal?

    Thanks, and congratulations for a great product!

    Alejandro
     
  2. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Hi Alejandro,

    Very nice bit of work! What size are the image maps you use eg for the wall adjacent to the stairs - roughly how many pixels? I found the motion quite jerky even on my GeForce 6800. I am curious as I am doing a simlar thing at the moment - baking lightmaps for an architectural exterior :(
    Yes - but you need to attach a script to the object to display the frames (the texture is a .mov file)
    Code (csharp):
    1.  
    2. function Update () {
    3.     // Calculate the frame to use by repeating time when it exceeds playLength
    4.     frameCount = texture.frameCount;
    5.     playLength = frameCount / framesPerSecond;
    6.     time = Mathf.Repeat (Time.time, playLength) / playLength;
    7.     var frame : int = time * frameCount;
    8.     frame = Mathf.Clamp (frame, 0, texture.frameCount -1);
    9.     texture.frame = frame;
    10. }
    11.  
    I am pretty sure the answer to this one is no. :(
    Not sure about this one - about to try some glass so will no doubt find out soon enough.


    Richard.

    Edit: Ooops things were jerky because Maya was rendering in the background!
     
  3. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Hello Richard,

    I basically used 512 px maps for eveything., There is roughly some 20 to 25 maps. Originally they were baked to 1024 though... There are some unwrap errors, but this is just a proof of concept so we did not put that much time on to it.

    Too bad on the AA. it would really spark things up! I;m not that worried upon sys requirements. The final product will be a kiosk (so i control the environment :) )

    Regards,

    Alejandro.
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Have you built the player with compress textures checked on?

    Compressing textures takes a while but if you use a lot of big textures it has a big impact on performance.
    If you enabled texture compression, the textures will be uploaded compressed to the graphics card.
    This means you can fit 4 times as many textures in your graphics card eg.

    25 * 512 * 512 * 4 = 25mb for uncompressed textures
    25 * 512 * 512 * 1 = 7mb for compressed textures

    On top of this you add 10mb for the frame buffer and system use of the vram.
    And you already used up the available vram on 32mb graphics card.


    We are definately planning on supporting AA in the standalone player within unity 1.x.

    Btw. if you need it right now, you can build a web player instead of a standalone. That has AA always enabled.
     
  5. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Thanks for your reply

    I used texture compression, but strangely the stand alone comes out as 28 megs, while the web version comes as only 7 megs. Is this normal? does the engine have that much of an overhead?

    Thanks,

    Alejandro.

    EDIT:
    a web version is available here:
    http://bogota.zerofractal.com/alejandro.gonzalez/VR Demo/web/Web test.zip

    i had problems with mime types to publish it online... so i had to make an archive. Any tips using IIS? i added a mime called .unityweb application/x-unity, but maybe the extension is too long or something :S

    Also the AA seems weak in the web player as well i really hope you can add this options to the stand alone, maybe letting the user specify at the beginig the AA level (1x, 2x, etc...)
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The web player does zip compression of all data.
     
  7. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    nice!. i have posted above my web test and some observations.
     
  8. SupaPuerco

    SupaPuerco

    Joined:
    Aug 17, 2005
    Posts:
    48
    WOW! That looks awesome! How is the texture baking done? Inside Unity?
     
  9. DaveyJJ

    DaveyJJ

    Joined:
    Mar 24, 2005
    Posts:
    1,558
    Very nice. We're tackling something like this too...how did you do the collissions with the railings etc? Are they empty game objects with narrow box colliders attached? And the sliding glass doors are great. Did you use Maya to bake the textures? Really, really nice work.
     
  10. xacto

    xacto

    Joined:
    Jul 20, 2005
    Posts:
    112
    :D Nice! Would love to see a screenshot of how it is set up within Unity. Are objects (ie stairs) just box colliders?
     
  11. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Supa, Texture baking is done within the 3d pacckage, it consists of unwrapping the objects so that you can project the textures an lights onto a texture. This way all of the detail of global illuminated spaces can be caputed onto a set of textures, and no lighting needs to be done fom the 3d engine.

    Davey, The collisions for railings and furniture were done by mesh colliders. We created some box which are invisible but act as deflectors. This is done for railings too. We are using 3dsmax and vray for 3d and baking.

    Xacto, attached is a screenshot of the unity setup. As you can see the project has 0 lights. Thanks for your kind comments.
     

    Attached Files:

  12. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    That is an astonishing use of Unity guys, it looks beautiful. Texture baking is obviously the way to go here, I understand C4D 9.5 has upgraded it baking abilities so I guess I'd best upgrade :?
    Thanks for showing it.
    Boxy
     
  13. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    You could try using a shorter file extension. The web player shouldn't care as long as the reported mime type is correct.
     
  14. Danni

    Danni

    Joined:
    Jun 8, 2005
    Posts:
    41
    This looks really great. And a great example of baked textures and the difference it can make. Keep us updated.

    Danni

    PS. I Really like the fact that you downloaded the trial yesterday, and the next day you have something to show! :eek:
     
  15. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Thanks danni. having 15 days to try a product you cant affor to waste a minute. On the other hand, I foun d unity quite easy to use, plus it had a first person camera pre-pabed :).
     
  16. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    That is incredible looking!! I'm going to have to learn how to do textur baking now! Keep us updated on your work, I wold love to see more! Jeff
     
  17. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Thansk for your comments. I am now trying to make a splash screen which fades in and out but I am quite lost.

    For the splash screen need to be ^2? or can it be a screen size such as 800x600?

    Is there any way to force the aspect ratio to 1? Gui textures deform to the aspect of the screen...

    Is there a guide on how to fade in and out a Gui texture?

    Sorry to bother,

    Alejandro.
     
  18. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Splash screens have to be power of two as well, at the moment

    For GooBall we settled for 1024x512. Then we put the splash screen on a cube and made a camera point at it. If the user is on a widescreen, the camera only gets wider...

    Basically we made a screen at 16:9, rescaled it to 1024x512, then put it on a scaled box that was 16:9. Then we just set up a fullscreen camera that fitted precisely at top and bottom
     
  19. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
  20. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
  21. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
  22. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    more brilliance :)
    Boxy
     
  23. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Dont foget to go tu the turning box at the end of the hall!! :) When the Gui is finished it will be clearer.

    Regards,
     
  24. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Yes I forgot to mention, that was an unexpected and delightful surprise -EDIT - might be fun to try some magic shader stuff on the cube eventually! Was that from the manual? (I confess work has taken over again, gonna have to remember everything I was learning!!)
    Thanks
    Boxy
     
  25. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    What? the shader, just now is a Standard Alpha. I would like to give a shot to magic shaders. The movements is just a simple transform on update.
     
  26. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Sorry - I meant the movement of the cube and sending viewer to another room, but I guess that is to do with triggers and other things I have yet to learn :)
    Actually I think the player/viewer could maybe do with a bit faster walking movement?
    Boxy
     
  27. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    My bad. I sucesfully created the mime type .unityweb application/x-unity. A running version of my demo can be seen here:
    bogota.zerofractal.com/alejandro.gonzalez/VR%20Demo/web/

    It seems i created the mime type in the wrong place. I now did it for all of the IIS and it works like a charm. Sorry for the missinformation.
     
  28. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Feels just great walking around that huge lobby!

    Richard.
     
  29. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Ok guys, Trial is over :( This is as far as I got:

    Stand Alone:
    http://bogota.zerofractal.com/alejandro.gonzalez/VR Demo/stand-alone/VR Demo.zip

    Web:
    http://bogota.zerofractal.com/alejandro.gonzalez/VR Demo/web/

    Widget:
    http://bogota.zerofractal.com/alejandro.gonzalez/VR Demo/stand-alone/VR Demo Widget.zip

    Thanks for all the support. The forum and the programmers are the best source of knowledge :). I hope to have a seller here. If so you'll hear from me very soon when we purchase the pro version.

    Just one word to describe Unity: COOL!
     
  30. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    Beatuiful work. Thanks for the visit, hope you'll stay.

    d.
     
  31. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Thanks david! We hope to purchase soon.. From the engines we tested Unity exceled in pretty much everything. Very good app for a version 1. I just can't imagine how a version 2 o3 will look like!

    Thanks once again. Too bad trial is over :wink:

    A.
     
  32. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    That really is awesome. I have absolutely no doubt you'll be back with even more inspiring stuff soon :)
    Thanks
    Boxy
     
  33. SupaPuerco

    SupaPuerco

    Joined:
    Aug 17, 2005
    Posts:
    48
    Not sure what's causing this, but I get a not-so-great rendering of the scene. It might be my kickin' GeForce4 MX (doesn't do normal mapping! hurrah!), or it might be a bug in the shaders or something, but here's what it looks like on my computer.
     

    Attached Files:

  34. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    That looks so awful!
     
  35. SupaPuerco

    SupaPuerco

    Joined:
    Aug 17, 2005
    Posts:
    48
    The very first version you had didn't have the boxes on the objects, but it was still dark. I didn't even know it was supposed to be daytime until I saw your screenshot. Also this is a weird problem, because all other unity things are normal.
     
  36. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    could this happen somehow if the textures exceeded the available VRAM or something? I've tried on My powerbook g4, on a dual g5, and on a mac mini and it seems to work on all. it lags a bit on the mini, but its almost up to the challenge.
     
  37. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    This is probably due to lack of memory on the graphics card. It simply can't hold enough textures in memory at the same time.
     
  38. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    freyr,

    is there any way to programatically query the amount of current graphics card RAM usage and capacity? That would rock, because one could actually handle this issues from the application itself.
     
  39. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    We will add more functions to query the graphics card capabilities.

    We will also be looking at the issues on geforce2mx and rage128's.
    Also there were some issues reported by aarku on geforce2mx, which we will look at.
     
  40. Red Ocktober

    Red Ocktober

    Joined:
    Oct 28, 2005
    Posts:
    84
    hi there guys...

    first of all, i'd like to say how impressed i was with the project demo... so much so, that i'm considering having a single dwelling built based on the layout of the living area in the demo 8)


    i wanted to pass this on to you though, as it may be of some interest... what initially impressed me was the feeling of 'presence' that your demo imparted...

    in the lobby area, i went behind the reception desk, and the panoramic view of the lobby really came across... i actually felt as if i was standing in the scene, and could thus get a true appreciation for what, i assume, was the purpose of the walkthru, to give a prospective client a first person perspective of the architectural design...

    but... unnoticed by me at the time was the fact that i was viewing the scene on a monitor that was, by a defect, shrinking the height of the display, so that it approximated a dvd movie being viewed in widescreen (letterbox) format...

    when i viewed the demo in the normal aspect on another monitor, the feeling of 'presence' was greatly diminished...

    i bring this to your attention so that you may consider the importance of

    1- the viewport aspect of the final project
    2- the possibility of using a widescreen aspect monitor or display to showcase your work...

    the panoramic view of widescreen adds greatly to the presentation, in my opinion...


    finally... those last shots where the scene was darkened and parts were blacked out... i got the same thing when i tested the demo on a imac G3 (blue case) 10.2.something and a different (less powerful) video card... i hope this is of some help pointing you towards resolution of the problem...


    --Mike