resolveView() function in shader

Hi, I find the resolveView() reference in most of the vertex shaders e.g. DepthOnlyVertexShader.usf. I’m guessing it produces the necessary view matrices for the current view. Please correct me if I’m wrong. In regards to that, I have a couple of questions.

  1. How is the resolveView() function created ? I mean is there a way to look into the function. Turns out, there is no such function in the UE4 codebase.

  2. Is it possible to generate the depth buffer from a different viewpoint if I pass the view matrix of that location ? In other words, is it possible to run the resolveView() function from a different viewpoint, even if I am at the current viewpoint ? This would enable me to capture the depth buffer or run any vertex shader from another viewpoint.

Any help in this regards is highly appreciated. Thanks :slight_smile:

  1. ResolveView does nothing more, but determines which view in stereo pair is the shader running in.
    Contents of the function are generated by shader compiler and not stored in shader files. You can check its content in ShaderCompiler.cpp, around line 2700

  2. ResolveView in particular has nothing to do with this. Use a depth only scene capture.

Thanks , I understand. So in order to do the depth only scene capture, do I need to make changes in the depthOnly shaders ? Or only changes in the c++ layer. It seems like the initialization of the variables of ViewInfo are scattered over the entire codebase. So generating the viewInfo of the different viewpoint might be difficult. Do I have any other alternative ? Can you point me in the direction as to where I can make the changes ?