Announcement

Collapse
No announcement yet.

Reflection of lights in glass-floor ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by jixor
    Wow, that is godamn sweet. However on a side note, how was the lighting done? I didn't know textures were able to cast light (assuming that is what has been done here), and if that is the case how do you re-build this lighting?
    They can't. Go into the groups window, there should be a "lights" group that's hidden. There's just so many (one for every wall light, two for every light in the floor panel, and a bunch more bounce lights) that they got in the way, so I hid them.

    I hope that I am able to adapt this scripting to my own mapping some time, its just so nice.
    I hope you can make it work. I never did test it online btw, so there's probably some bugs that need to be worked out there.

    Leave a comment:


  • replied
    Wow, that is godamn sweet. However on a side note, how was the lighting done? I didn't know textures were able to cast light (assuming that is what has been done here), and if that is the case how do you re-build this lighting?

    I hope that I am able to adapt this scripting to my own mapping some time, its just so nice.

    Leave a comment:


  • replied
    Don't use the version in the map above, it sucks and doesn't work right even for single player.

    Use the version in this map. I still haven't tested it in a net game, but it least it works properly for single player. Here's the screenshots used in the preview:



    Two issues remain in the zippped map though:

    1. blood emitters show up in first person
    2. the translocator hovers out in front of you when you have the translocator gun active and you're in a ReflectionVisVolume.

    I figured out the fix but I didn't want to produce a whole new zip file to change one line of code. In ReflectionMaster's PreRenderReflection function, change the line:

    if (A.bHidden || hideActor == A || hideActor == A.Owner)

    to

    if (A.bHidden || hideActor == A || hideActor == A.Base)

    Make that change, hit the "recompile changed" button, and save out the map file to fix it.

    Leave a comment:


  • replied
    [edit]Don't use the code in this map. It sucks. bad.[/edit]



    The map.

    This is so horrendously hacky I'm amazed it works at all. It still has one big issue though. I can't figure out how the engine decides when and when not to draw the player model. right now I'm skipping the local PlayerControler's ViewTarget when bBehindView == false. I've had problems with the player model still drawing though.

    Another more cosmetic issue it has is that players may be chopped off as they pass through a hole in a reflection. There isn't any universal way around this but there are two options:
    1. make the z-cover mesh dip down into the hole at least half the height of the player.
    2. implement the double-draw functionality that I have variables in there to support.

    Now for the 600-words-or-less how and why:

    Create the area you want to be reflected normally. When you're done, create a model of any BSP geometry you want to be reflected. Place all reflected meshes and reflected BSP models into the map in their correct reflected location, and tag them all with some unique tag, maybe involving "reflect".

    Now make a model an approximate convex hull of the reflected room, with the polygons facing in (if you're in Maya, turn on back-face culling), and the reflection surface missing. Place this in the map in the reflected position and make sure it holds the reflection correctly. give it some other unique tag, maybe involving "cut".

    Now you need to make a model of any geometry that needs to occlude the reflection, including holes in the reflective surface and any BSP geometry around the mirror and outside the mirror that may obstruct it. It also needs to include any reflected geometry that should occlude reflections. If there is reflected geometry that will also be occluding reflections, the occluding mesh should be set with the front face of that shape facing in, so that it's backface gets rendered. Place this (or these) mode(s) in the map and give them yet another unique tag, maybe involving "cover".

    Now, select any static non-coliding actors outside the mirror that will be occluding it. Give them all some unqiue tag, maybe including "overlay".

    Finally, set up the builder brush to contain all parts of the level where the reflection will be visible from, and add a ReflectionVisVolume. Select it and open the properties window. Set the reflectionTag, cutTag, coverTag, and overlayTag to match the tags you entered earlier.

    How it works:

    As I said, this is incredibly hackish. Lets start with how the actual rendering of the reflection happens.

    The reflection is drawn as a three pass process after the world has completely draw. These steps are:
    1. cut out a hole in the z-buffer that the reflection can draw into
    2. cover up that hole in any places where the reflection should be hidden
    3. draw the reflection.

    however, this has a problem - it draws on top of objects in front of the reflecting surface. To fix this we can take two approaches:
    A. alter step 2 to also cover up anywhere that there's something in front of the reflection, or
    B. wait until after step 1 to draw any objects in front of the reflection.

    Both of these are possible in this code. Approach B doesn't work for BSP geometry (which is all rendered at once in the very first stage of rendering), so we use a model containing selected BSP faces to use in step 2. However, for objects we just hide them during the normal rendering phase and manually render them after the last step. It might be more efficient to render them immediately after step 1, but I didn't think of that at the time, and transparent actors would cause artifacting. [edit]just realized this would also cause problems with BSP inside the reflection vis volume not occluding players behind it and in front of the reflection.[/edit]

    To actually accomplish this controlled drawing we need to get draw time after the world has finished it's normal drawing but before the HUD has drawn. The first attempt was made using a Interaction, but it was discovered that the HUD and weapon in hand are rendered before interactions get control. To get around this a HUD wrapper is used that is put in place in PreRender and removed in PostRender. In PreRender we also go through the volume and object lists to find which objects need to be hidden. In the HUD's PostRender we call into our code to do the reflection drawing before calling the original HUD's PostRender.

    damnit, went over. 606 words.

    Leave a comment:


  • replied
    Originally posted by Yakomo
    I think you should perfectionise this and make a tutorial out of it. This is most definitely something that ppl would want in their map!
    I was going to put together a little "how to use it" deal and some example setups, but I wasn't going to go into a full tutorial because of the complexity and variations involved. If you have the skills required to do it right you should already be able to get from "how it works" and "how it's done" to "how to do it". One important thing you might want to know is that using this setup requiers at least 3 custom meshes (one simple convex one (er, concave... er... well, hard to explain) for the z cut, another more complex one for the z cover, plus one one mesh of any reflected object with the face turning reversed (inside out). Plus, if you're reflecting BSP you'll need a mesh of the visible parts opf the BSP being reflected (which you can't create in the editor).

    I'm still trying to work out draw order issues. I'm using an Interaction to draw the reflection dead last, but that makes it draw on top of any actors in front of the reflection. Not as noticeable as actors behind the reflection not drawing at all, but still not good :|. I have a potential solution, but it seems to be extremely evil and potentially breakage causing: hide actors inside reflection visibility volumes and draw them after all reflections.

    (BTW, my plan is to hide them in PreRender and show them again after PostRender, by setting the draw type to DT_None and saving the original draw type elsewhere.)

    Leave a comment:


  • replied
    These are the most realistic reflections of light that I ever saw in ANY map

    Before walking through inio's example-map I thought it would be nice to have reflections but after that I JUST HAVE TO HAVE THESE REFLECTIONS !!!!!!!!!!!!!!!!!!!!

    I think you should perfectionise this and make a tutorial out of it. This is most definitely something that ppl would want in their map!

    @Fecal Marmaset: Also a very nice solution to the problem I think its a smart idea. :up:

    I can't thank you guys enough for putting so much time into my prob but I really think it is worth it cause this effect belongs in more maps! Just look at it!

    Leave a comment:


  • replied
    I have a solution for the over/under setup working ok. Once I get it working acceptably I'll post it (right now it's really ugly, but proves that it's possible )

    Leave a comment:


  • replied
    If you exhaust all possibilities, and it just isn't working out. Don't give up, there's always the "old-fashioned" way. Call it simple deception.

    Below is a screenshot of an example map I made for you....as well as a link to the map.

    The catch is.....you've got to screw with geometry and lighting to get the "effect" to work.

    Please pardon the crudeness of the example as I just "whipped" it together.

    Lemme know if you have any questions.
    :up:



    BTW....there is a little hole cut, so you can drop down to the lower floor.

    http://www.crowbarketchup.com/Rich/Reflection.zip

    Leave a comment:


  • replied
    Originally posted by yourLittleTeddy
    didn't I mention that cube map thing...? problem of it is the inaccurate reflection in the corner cubemaps have.
    Cube-maps wouldn't accurately track the position of the reflected light. Cube maps are good when you have a small reflecting object in a large complex room (like CTF-FaceIII), but don't work well when you are precisely reflecting off a large flat reflective surface.

    lol... I'm mapping a very long time now - but I really needed time to get a clue how you made it - pretty tricky... am curious why that was not my idea... and it only needs half the space, my idea would need - tell me I'm right!
    Your idea as stated (as used in many classic games including Mario 64), doesn't allow for there both to be a transmitted (sub-floor) and reflected room. This technique is a derivative of it but allows for the reflection to be properly drawn on top of the transmitted room (without having to worry about the transmitted room having space to hold the reflection.

    BTW, one bit that might confuse you that I set up incorrectly (it causes significant unnecessary overdraw): the coverz FinalBlend should have bTwoSided=false. Later today I'm gonna put together a new version with a demo of how you could do an over/under walkway setup - it'll have this bug fixed.

    Leave a comment:


  • replied
    didn't I mention that cube map thing...? problem of it is the inaccurate reflection in the corner cubemaps have.

    lol... I'm mapping a very long time now - but I really needed time to get a clue how you made it - pretty tricky... am curious why that was not my idea... and it only needs half the space, my idea would need - tell me I'm right!

    Leave a comment:


  • replied
    Originally posted by Yakomo
    The whole purpose of the glass-floor is so ppl can check from up or below where the flag carrier runs or if there is any incoming.
    If the area below is open, then you don't have to go through the shenanigans I did, but you won't be able to make the reflectiosn quite as convincing

    That is, if the world-space area where the reflected light would appear to be is open, you can put the reflected actor(s) there and then use a volume to show/hide the actor(s) when the player enters and exits the area which the reflection is visible from. You won't be able to do any of the z-buffer tricks I do to properly clip the reflection though - they would make players disappear behind the reflections. A a result you would need to model the reflection mesh to simlulate being clipped (which, unfortunately, is impossible for the leading corner if you want a square cut-out).

    The problem is that to do it right, you need to do bizarre things with the z-buffer that rely on the map objects being drawn in a very specific order. Other player pawns get added after any map objects, so they would be drawing into the z-buffer that had already been funkified by drawing the reflection.

    Leave a comment:


  • replied
    @inio:
    "Oh pweese oh pweese oh pweeeese tew me how it woks!"

    Just kidding, but it looks pretty much like what I need. Only thing that worries me is that the area below in fact IS accessible. The whole purpose of the glass-floor is so ppl can check from up or below where the flag carrier runs or if there is any incoming.

    @yourLittleTeddy & Xabora:
    The whole corridor is very low poly so no worries there. I could do almost anything in there without risking major performance drops even on low level machines. That is one of the reasons why I want to add some spice to it. But there IS something under it.

    Special thx @ inio for even trying something out! It really looks great. But you said "if the area is not accessible"!? So if its not possible like that I think I will try the cubemap thing like FOZZI suggests although I fear its tricky to get it right in such a close environment.

    But inio's screenshot gives everybody the perfect impression what I need!

    Thx everybody for helping me out here, I would not waste your time if this wasn't very important to me. I would try and try for weeks until I got it perfect but I don't have the time cause a very important (to me at least) mapping-project that almost lasted a year now nears its end and I want to add some finishing touches to it so the main mapper has more time to concentrate on the "really" important stuff.

    Leave a comment:


  • replied
    Alright, if the area below isn't player-accessible, you'll like this. I'm impressed with how good it looks. Unless someone posts something like "Oh pweese oh pweese oh pweeeese tew me how it woks!" I'm going to let you figure it out on your own (it's worth it).


    DM-LightReflectionDemo.zip (52k)

    Leave a comment:


  • replied
    Is the area below the glass player-accessible? I think yourLittleTeddy's idea would work if it isn't. I'm playing around with some other options if it is, I'll post in a bit depending on how well they work out...

    Leave a comment:


  • replied
    Originally posted by Xabora
    Or... apply the mirroring feature
    onto the bsp.
    You also may have to have
    Usestencil=True
    on in the ut2003.ini
    No that sucks, It's not 'might have to enable stencils' you DEFINATLY would have to, and they wouldnt work for people who didnt have it set or have low end systems.
    They are disabled for good reason. try it out before recomending it foo.

    B) Using a warpzone to make a fake "reflection" using a hidden room <- this is a good idea but it sucks too because warpzones are fecked in UED3.

    C) Cubemaps <- this looks good, has a low performance hit, is very controlable and its the way DE or epic would do it. recomended.

    Leave a comment:

Working...
X