Home Unreal Engine

Render To Texture for Reflections Help Needed

polycounter lvl 9
Offline / Send Message
Greg Westphal polycounter lvl 9
New user to UDK and I can't find RenderTo Texture. When I right click in my content browser to create one I don't actually find anything that starts with an R and the only two things with render in it is TextureRenderTarget2d and TextureRenderTargetCube. I've tried to use both but in every tutorial they start off as green and don't save any image. I have a scenecapturecubemap actor that is showing the reflections off nicely but I can't get it to save save to a texture. :/ Please help!

Replies

  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    those are what you want--they'll be green until they are hooked up to a SceneCaptureActor or a SceneCaptureCubeActor (each wires up to RenderTarget2d or RenderTargetCube respectively).
    I might be slightly off on the names, as it's been awhile.

    Anyway, those two actors are items you place in the scene itself. You can select them via the actor classes menu (a tab along side of the content browser) and then rightclick> somewhere in your scene to place them in the world. These actors have things like framerate, capture distance, etc as settings.

    Once they are placed, select them and then double click the TextureRenderTarget in your package--there's a field you can assign the scenecaptureactors to. You can also set resolution of the final capture here.

    To use these things, there are two similar nodes within the material editor that you can place in your materials. You have to point those materials to your rendertargets.

    It's worth mentioning that you can severe the realtime relationship between the scene actor and the render target via a right click option. If you don't need the target to update dynamically, this might be a good idea, as its a huge performance saver. If that's the case, you end up with a static cubemap or texture, which can be used in your materials with a standard texturesample or cubesample nodes. you can also set those rendertargets to update only once--on load--and that's a pretty good performancefriendly option as well.

    My apologies if the names are a bit off for this stuff--its been awhile since I've messed with it.
  • Greg Westphal
    Options
    Offline / Send Message
    Greg Westphal polycounter lvl 9
    those are what you want--they'll be green until they are hooked up to a SceneCaptureActor or a SceneCaptureCubeActor

    What if they aren't though? Whenever I create a TextureRenderTargetCube it comes in as black and when I set the capture actor to it there are no changes to the texture. I feel like I'm missing one setting somewhere that allows it to update but as the TextureRenderToCube only has a few and I've toggled everything I'm a bit at a loss.

    Thanks for helping btw
  • Money
    Options
    Offline / Send Message
    Money polycounter lvl 8
    Well one thing that comes to mind.
    When you right click on a cubemap texture and chose "create new static texture" select back arrow and then forward arrow in the content browser to change to a different package and return. Render texture will still show black once you create it, dunno why it happens, however it doesn't immediately show the ones it created, so just switch to another package and return to the one where render texture is.

    Just to confirm if picture 1 is what you get, that is actually after I created a static texture of it, switching to another package and back, then it will show the texture.
    rtt1m6zfn.jpg
    rtt2nibim.jpg
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    no worries-- sorry I skimmed/misread your earlier post--didnt see you had the scenecapture guys in there already. Hm...since youre dealing with cubemaps, forget rendertarget2d then. Be sure you're using RenderTargetCube.

    Next, click the scenecubecapture actor guy and make sure he's capturing enough of a distance--if it isn't then you might get a black texture. Likewise, try changing it to unlit to test--it might be that there's an issue with the lighting/postfx/etc? Do those fix anything for you?
  • Greg Westphal
    Options
    Offline / Send Message
    Greg Westphal polycounter lvl 9
    BlankSlateJoe: I adjusted the distance and changed the lighting and nothing happened when I did.

    Money: I should have checked that before I left my house. I saved the file so it should be there when I get back hopefully

    I had to rush out for school but as soon as I'm home I'll see if its fixed. I try really hard to do as much research as I can before I ask for help here but it seems that UDK has a lot of implied things that will just take time to figure out.
  • Greg Westphal
    Options
    Offline / Send Message
    Greg Westphal polycounter lvl 9
    Thanks to both of you, got home and on the reset of Unity it came up so I imagine it was the problem Money was talking about. Thats great. I was pulling my hair out for about 8 hours trying to get this thing to work and all I needed to do was refresh the engine. Thanks again.
Sign In or Register to comment.