Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Am i right that unreal can't get a simple color value from a texture?

This seems like a really simple thing but from searching and trying all sorts of stuff i can't seems to take a texture in the material editor and get an average color output to use.

Im doing it for a small lighting project like those tv's which give ambient lighting behind based on the colors of an image.

Unreal doesn't seem capable of it so im not sure if unity might be better for the job?

Product Version: UE 4.15
more ▼

asked Jun 25 '16 at 12:07 PM in Using UE4

avatar image

23 4 7 11

avatar image Prithvi Singh Jun 25 '16 at 12:36 PM

can you provide a reference to what exactly you want it to look like?

avatar image Magneto Jun 26 '16 at 10:12 AM

Im trying to get something like this.

In the material editor you have inputs like textures and colors. You can easily change a color and use it as if it was a texture but you can't seem to take a texture and get a common color output for use with something like a point light.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I've created an effect like this in Unity but haven't had a chance to try it in Unreal Engine, yet. But the same approach should be valid...

In Unity, I placed a camera directly in front of the screen so that it only captured the screen. I had this camera render its output to a very low resolution (2x2) texture. The result was that it averaged the colors for me. I then used that texture in a custom shader to produce the glow/flicker effect.

In Unreal, I believe you'd use a Scene Capture 2D object as your camera and have it render to a Render Target texture asset. You could then use this texture asset in a custom material to do whatever you'd like with the averaged color it produces.

Caveat, I haven't yet tried this so I can't promise it will work. But try it and report back here if you succeed!

more ▼

answered Jun 26 '16 at 09:19 PM

avatar image

825 27 15 57

avatar image Magneto Apr 09 '17 at 12:13 PM

I forgot about this but to anyone looking it turns out to work but im not sure the colors are quite right?

Im still hoping there's a trick to convert textures to color values as it could possibly give more control and better results?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

It's limitation of shaders and GPU overall, note that material is a shader, graph you making is turned to HLSL code so you directly bound to it's features and limitations + in UE4 you also bounded to limitation of UE4 rendering process and how it handles shaders. In shaders as code you can process only one pixel you actively working on and you can request pixel color only from samplers (in UE4 nodes with UV input). Sadly there no way of getting frame you working on as it simply... not ready yet, you sahder code walking on it :p And with UE4 you can only get pixels behind object (SceneTexture), pixels reflections and stuff like that.

Theres a quite simple but little bit expansive work around, make a material function insted of material, make it input UV map and with that UV map generate pixel you would generate at that position, then in main material use that function to regenerate pixels from other positions. If you want to optimize it more you dont need to use material function and make diffrent liter way to recostruct those pixels dpending on need, material function would simply look nice insted of copy pasteing same graph

On thing you trying to do you could maybe do something on Post Processing level


more ▼

answered Jun 26 '16 at 03:24 PM

avatar image

36.7k 932 169 1111

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question