Home Unreal Engine

Scenecaptureactor - Reflection issues

Ok so i'm still what i would consider new to UDK and have been writing a set of tutorials both for my own reference and for a school assignment.

I have been trying to figure out how to create reflections for my little mock up hallway and i must be retarded because i cannot for the life of me get things to work the way i want.

The first thing i tried was creating a cube map and using it in my material for the floor. It almost achieved what i wanted but the rotation on the reflection was slightly off for it to look correct. I have no idea if there is a way to adjust the rotation of the reflection at all but i have a feeling i shouldn't need to and i'm doing something wrong.

Could the uv layout or anything like that be causing issues? The floor is only using part of the uv map because i was planning on using it for multiple things, but i wouldn't think that's causing the issue

Reflection3.jpg

Reflection4-1.jpg

So i started using Tor Flick's project as reference which was made downloadable because hes awesome. It is this project here http://www.torfrick.com/info/lab.html

I noticed he was using a Scenecapturereflect actor which was attached to a TextureRenderTarget2d. The reflection on the ground is what shows. So i gave this a shot and mine ended up being a solid reflection instead of just partial. Now i'm sure hes got a fancy trick or something for this but i cannot get anything like it. My reflectactor hides the floor beneath and i haven't found any information on how to get the same effect.

Reflection1.jpg
Reflection2.jpg

Now im pretty sure im just retarded because everyone else seems to figure out things just fine but its been driving me crazy and i really need help since i don't know anyone personally that knows UDK. Anyone that can give me an insight into WTF im missing would be greatly appreciated.

Replies

  • Angry Beaver
    Options
    Offline / Send Message
    Angry Beaver polycounter lvl 7
    Your material is really weird...
    Why are you adding the reflection to colour? Think of nodes like a mathematical formula applied to every pixel. If you add a white floor texture to anything your going to get a white texture 1,1,1 + x,x,x is 1,1,1 with a little bit of bloom and that's still white. also that multiply by 1 is pointless.

    just go right from your Reflections texture sample into the lerp.
  • Darkleopard
    Options
    Offline / Send Message
    Thanks for your input, i fixed the material nodes up. Ive been following different tutorials and anything i can find to help me out so that's why i had irrelevant nodes in there, i guess i wasn't thinking at 1am.

    That still does not help me in anyway with my actual problem though. Some input on that would be appreciated.

    I was wondering if the position of the sphere used for the cubemap capture was slightly off, could that cause the reflection to also end up slightly off. Perhaps i didnt have it in the exact center or something
  • kyle.rau
    Options
    Offline / Send Message
    kyle.rau polycounter lvl 8
    what Beaver said is correct. connect your reflection nodes (texture sample, vector/reflection nodes) directly into A of your lerp, then connect just the regular texture into B of the lerp. then use the constant that's already plugged into the lerp to set how much reflection you want to see. you should have 6 total nodes there instead of 9 in your original screenshot. that should give you a good start on making a spiffy reflective floor :)
  • Darkleopard
    Options
    Offline / Send Message
    If you read my response, i already fixed that.

    Now i would like help with the actual questions i asked help with. The floor reflects the image in the material just fine. What its not doing is reflecting it on the right rotation, its slightly to the side when it should not be.

    Please actually read through the thread then post
  • kyle.rau
    Options
    Offline / Send Message
    kyle.rau polycounter lvl 8
    i'm sorry. i saw the last image you had and saw that you had the reflection lining up properly. the reflection actor you're using there is the one for floors basically. the cube map way will give you the results in the first image.

    so i'm a little confused. you're saying the reflection is not lining up properly, or reflecting in the right rotation as you have said, yet the last image you posted it looks like it is.
  • Darkleopard
    Options
    Offline / Send Message
    Right so, if you look at Tor flicks example, his reflections use the same actors yet don't obscurer the floor itself. If you look at my first picture you will see the floor static mesh, but in my last picture, the reflection is hiding the floor completely before the reflection is solid.

    I want to see the reflections and the floor like in tors example but i cant find a way to do this

    Hope that makes sense
  • kyle.rau
    Options
    Offline / Send Message
    kyle.rau polycounter lvl 8
    oh my bad that's the actor itself, not the floor mesh with the reflection? when you go into Game mode, it will hide it and you'll just see your floor without the actor covering it up. if it is really annoying, you can just put it right below the floor (it will capture through the floor still to the ceiling etc)

    i'm not sure how Tor made his small and out of the way. i've never tried, i just hide mine below the floor. as for the reflections on top of the floor in the shader, sounds like you got that covered?
  • Darkleopard
    Options
    Offline / Send Message
    Its so hard to explain over text :D

    I am trying to figure out how to get the same reflections on my floor. You see my last picture where the actor reflections everything perfectly, How do i get that into reflect in my floor material exactly as it looks now.

    Everything i have tried when putting that reflection into the floor material, does not reflect everything on the same angle. If you see my first picture, i have reflection working but its on an angle, not reflecting whats directly above it.

    Reflection3-1.jpg

    Edit: I have that actor connected to a Texturerendertarget2d. Am i supposed to be using this to make a static texture because its not working when i do.
    I dont understand if im supposed to creating a texture from this actor and putting it into the material to reflect or if theres something else i should be doing.
  • Angry Beaver
    Options
    Offline / Send Message
    Angry Beaver polycounter lvl 7
    Your steps sound mostly right but I think there's a gotcha somewhere, unfortunately I can't spare any time in UDK to double check as I'm at work right now.
  • Darkleopard
    Options
    Offline / Send Message
    Yeah its driving me crazy, im not sure what im missing
  • Skillmister
    Options
    Offline / Send Message
    Skillmister polycounter lvl 11
    I'm not quite sure what you are trying to ask here...? In your comparison with Tors scene you are showing only the reflect actor on your screenshot, that is irrelevant as it will always look a certain way (and not show ingame) not determine how the reflection looks in your material.

    To put it in your material plug the texturerendertarget2d into a texture sample in the material with a screen pos and mask (R G) like this
    mat_ed_1.jpg

    That's the most simple of reflection setups. Then play around with strength of reflection as detailed above.
  • kyle.rau
    Options
    Offline / Send Message
    kyle.rau polycounter lvl 8
    Ah Skillmister beat me to it :)

    This should help also: http://forums.epicgames.com/threads/733910-Simple-Real-Time-Reflection-Distortion

    That whole thread is a good read.
  • Darkleopard
    Options
    Offline / Send Message
    YES! Thank you guys i found the solution. It was setting the screen position node to screen align, i had totally missed that step. I remember plugging it in and seeing the texture go crazy and thought that must not be it. I feel so silly.

    I had one more quick question. Since this type of reflection seems to be used for larger rooms and such, what is a cubemap normally used for?

    Reflectionworks.jpg

    Thanks so much for putting up with me :D Polycount is the best
  • Money
    Options
    Offline / Send Message
    Money polycounter lvl 8
    You really use cubemap for non planar objects and if you want reflections to be cheap (compared to the ones like using reflectactor).
Sign In or Register to comment.