Announcement

Collapse
No announcement yet.

Is UE4 using the DirectX API at all?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is UE4 using the DirectX API at all?

    I have been reading the shader documentation. See for example the following snippet about the cross compiler:

    "Cross compiler
    The HLSL Cross Compiler is used to automatically convert HLSL into GLSL for OpenGL platforms, allowing shaders to be authored only once for all platforms. It is run during offline shader compilation and performs various optimizations to the code that OpenGL drivers are frequently missing."

    So my understanding is that for OpenGL platforms, we can sill use the HLSL shader code because the cross compiler will automatically take care of the conversion process.

    * My question is about Windows platforms supporting DirectX. In this case Will UE4 use the HLSL code and call the DirectX API directly without any intermediate cross compiling?

    * I have a few vertex shaders written in HLSL language for the Windows/ Directx 11 combo. Can I call them straightaway in UE4? I notice that the UE4 shader files have an extension of usf!

    #2
    So my understanding is that for OpenGL platforms, we can sill use the HLSL shader code because the cross compiler will automatically take care of the conversion process.
    Yes, no need to duplicate shader source

    * My question is about Windows platforms supporting DirectX. In this case Will UE4 use the HLSL code and call the DirectX API directly without any intermediate cross compiling?
    Yes

    I have a few vertex shaders written in HLSL language for the Windows/ Directx 11 combo. Can I call them straightaway in UE4? I notice that the UE4 shader files have an extension of usf!
    No, they need to be integrated into either a global shader (usually only used for things like full-screen quads), vertex factory (for support of a certain mesh type), or FMeshMaterialShader (for support of a certain pass). It can be quite a bit of work, but allows the engine to automatically make any material work with any mesh type or rendering pass.

    Comment


      #3
      Thanks DanielW. Is there a document somewhere that talks about UE4 shader programming? I am particularly interested in writing vertex shaders for vertex texture fectches.

      Comment

      Working...
      X