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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Vertex Colors Too Bright

Hi! We've added support for linear vertex colors to both static and skeletal meshes in UE4, as we need full 32-bit float precision for our project. This worked fine in version 4.19.

We recently upgraded to 4.21.1. We have an asset that uses both textures and vertex colors, and the two should blend seamlessly. In 4.19, they did. In 4.21.1, they do blend seamlessly when the asset is imported as a skeletal mesh. However, as a static mesh, the vertex color sections are much brighter than the textured sections.

Furthermore, we have a test that takes a plane that we generated with a specific "hardcoded" grayscale floating-point vertex color, renders it fullscreen without any post-processing to a render target, and reads back the rendered pixels to confirm their value matches the input value (we added support for reading back 32-bit float values from a framebuffer). In 4.21.1, the hardcoded grayscale value is 0.540021. The rendered value is 0.70784. As you can see, quite a difference!

The difference is still there if I use OpenGL instead of Vulkan, so that's not the issue.

My guess is it may have something to do with the new work to make static and skeletal meshes siblings? I know there's been a lot of behind-the-scenes work to redo how UE4 imports/generates static meshes. In fact, I rewrote one the importer for our custom asset type to use the new MeshDescription object. I simply store the linear vertex color value directly into the MeshDescription's VertexInstanceAttribute's Color array. But we're still seeing the issue.

Perhaps there's an associated shader I need to investigate? Perhaps some other adjustment is being done that I'm missing at present? Maybe there's a new post-processing feature I need to disable somewhere?

Any advice or thoughts on where to look would be much appreciated!

Product Version: UE 4.21
more ▼

asked Jan 15 '19 at 04:47 PM in Rendering

avatar image

2 2 1 7

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

After a lunch break, I had the thought that I should double-check the code that utilizes the VertexInstanceAttribute's Color array. Sure enough, there's new code there to "build" a static mesh, and it needed to be updated to support linear vertex colors.

By default, it just converts the linear color to an fcolor, and does sRGB conversion.


more ▼

answered Jan 15 '19 at 08:43 PM

avatar image

2 2 1 7

(comments are locked)
10|2000 characters needed characters left
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