Home Unreal Engine

Assigning a Cube Map to a Bubble (help?)

(first post :))

Hey everybody!
I'm writing a shader for this transparent, green, glowy material that needs to look very "chemical-ish".
I'm running into some issues with getting a cube map to assign to a circular alpha mask that needs to pan up and drift around (bubbles). I'm brand new at writing shaders, so I'm sure there's a very efficient way to do this.

As I'm writing this I'm remembering that a cube map is a three dimensional record, and the mask for the bubble would be a 2d image. Is there a way I can set different faces of the cube map to appear depending on which world direction the material is facing?

Thanks guys!

Replies

  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    there shouldn't be any problem with just using a 2d mask with a cube map? what does your shader network look like at the moment?
  • Nielsen
    Options
    Offline / Send Message
    Nielsen polycounter lvl 8
    You're creating some confusion by saying "writing a shader" at least in my mind. Let's just assume you're using the material editor for it.

    I quickly slapped together a little example for you.
    Don't mind the graphics, if you use proper textures it'll look good, it's mainly the normal map that's destroying the reflection here. I suggest you use something like a simple dot for a normal so that the reflection bends around the edges a bit.

    a9mt1.jpg

    I added some panning to everything for fun to show you how that works. It stretches the reflection in real time (which can be quite handy really) but depending on what you want you can also disable that completely and not input the multiplier at all and just go with the reflection -> transform -> into UV slot for the texture.

    Here's the reflection without the normal input to show you the difference.

    0fcAo.jpg
Sign In or Register to comment.