Materials look blurry/orange when loading into world in package/editor

Hi,

good to know that CVar change caused the issue. The code that creates the fallback color for virtual textures that have not streamed in fully yet is in two places in FVirtualTextureDataBuilder::BuildLayerBlocks() in VirtualTextureDataBuilder.cpp. Look for the following code which appears twice in the file:

// Extract fallback color from last mip.
{
	// this actually just samples one pixel ; it comes from last mip so it's often small already
	// @todo Oodle : just use a "get average color" function
	FImage OnePixelImage(1, 1, 1, ERawImageFormat::RGBA32F);
	BlockData.Mips.Last().ResizeTo(OnePixelImage, 1, 1, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
	OutData.LayerFallbackColors[LayerIndex] = OnePixelImage.AsRGBA32F()[0];
}

As you can see from the comments, the code is actually just sampling the texture’s smallest mip instead of calculating an average. You could implement some logic here that averages the pixels of the smallest mip and replace the fallback color (OnePixelImage.AsRGBA32F()[0]).

Regards,

Sam

[Attachment Removed]

This makes sense, I think knowing this now we can probably adjust the shader to be more correct, we are *multiplying* the output of the texture sample by an emmisive color thats like (4.678502, 0.5, 0) which means that even if this pixel value is 0.01 it will make the entire thing glow.

I dont think changing the engine to do the average color will solve this issue for us because of what I said above for the shader.

Thanks for the help, I will try fixing the shader tomorrow

[Attachment Removed]

Hi,

No problem and thanks for clarifying that, it explains why the glow occurs.

Would it be okay if I close this case now? You can keep it open if you have further questions.

Thanks,

Sam

[Attachment Removed]

You can close it now, we will work around it in the shader, thank you for your help :slight_smile:

[Attachment Removed]

No problem, glad I could help.

Best,

Sam

[Attachment Removed]

I just wanted to add one comment here is that it would be amazing *if* we could set the fallback color in the virtual texture settings. Now that this is enabled by default, most people will not understand what is going on and is going to cause a lot of visual artifacts for people when loading into maps, but if a user can set it to fall back to black, that would probably solve a lot of these issues.

[Attachment Removed]

Hi,

Thanks for this suggestion, that makes sense. I have notified Epic of your feature request and will provide an update once I know more.

Best regards,

Sam

[Attachment Removed]

Thanks, sounds good!

[Attachment Removed]

Hi,

As an update, Epic has notified me that they have submitted your request and feedback internally.

Thanks again,

Sam

[Attachment Removed]