How can I get a .usf file to read a value from the World Settings?

How can I get a .usf file to read a value from the World Settings? I want to be able to use a value in the World Settings inside BasePixelShader.usf. How can I do that?

A USF file is an Unreal Shader file. It means that is a program that runs on the GPU.

To pass variables to a shader, you have to create a parameter value in a material and then you can update that however you want. If you want to change a particular parameter in the BasePixelShader, you have to search where Unreal bind that to an actual c++ shader uniform, and update that.