Home Unreal Engine

Flickering Light controlled with texture

polycounter lvl 3
Offline / Send Message
RickiPicker polycounter lvl 3
Hello,

I'm trying to make a flickering light that i can fully control.

So the idea is simple. Lerp node works as some kind of gate. The mask is horizontal panned texture with black and white squares inside. I thought that with this i will be able to "paint" the flickering.

The problem is that UE 4 always changes my texture to square no matter if its 10x1. How can i fix this?

Anyway is this good idea? Would love to hear more ways to do this kind of thing :)

Thanks for help!

Replies

  • Harbinger
    Options
    Offline / Send Message
    Harbinger polycounter lvl 8
    Textures always have to be in dimensions of powers of 2, so a 10x1 texture won't work. You could do a 8x2 texture, although that's tiny. Try a 128x16. Also, probably no need for a lerp, just treat the texture as a mask.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    The lerp is a good idea actually, so you can better set min and max values depending on the specific light needs while using the scrolling texture as the alpha. Gets you much more mileage out of a single texture.

    Second: Textures don't have to be a power of 2 anymore, you just don't get mipmaps if they aren't. But if you're going to do any bit of texture compression you will want to go with something like a 32x4 texture and paint in blocks of 2x2 pixels or so at minimum (because of how DTX Texture compression works).

    Third: The texture isn't being converted to a square. Its being *Displayed* as a square, because regardless of actual dimension, its mapped in memory/UV space from 0 to 1 on each axis. Check the actual texture object in your asset browser. It should show you the actual dimensions.

    And yes this is a fine idea for a controllable flickering light.

    I personally enjoy mathematical solutions: http://www.polycount.com/forum/showthread.php?t=126722
    That solution one trades precise control for something close to true randomness.
Sign In or Register to comment.