Are hlsl shaders not a thing in ue4?

Hi, Ive seen a few topics about this, but no solid answer (from what i’ve seen)

all I want to do is get this shader, which is the most simple shader i can think of, into ue4 and onto an object:

// vertex shader

float4x4 matViewProjection;

struct VS_INPUT 
{
   float4 Position : POSITION0;
   
};

struct VS_OUTPUT 
{
   float4 Position : POSITION0;
   
};

VS_OUTPUT vs_main( VS_INPUT Input )
{
   VS_OUTPUT Output;

   Output.Position = mul( Input.Position, matViewProjection );
   
   return( Output );
   
}

// fragment shader

float4 ps_main() : COLOR0
{   
   return( float4( 1.0f, 0.0f, 0.0f, 1.0f ) );
}

is it even possible to get this simple hlsl shader working in ue4 without having to recreate everything with nodes?

Specifically, I want to write my shaders for ue4 in Visual Studio. I want to develop these shaders sp they work accross the board; ie, they are the same in maya, max, ue4, etc.

thanks for any help

bump - I’m still looking for an answer to this simple question : (

this is what is said in the unreal wiki for hlsl shaders: " while it is possible to use normal HLSL shaders in UE4, there doesn’t seem to be any tutorials for it yet, and there are some complications that make it necessary to take a few detours before you can actually create and run your shader. It is worth to note that this is not a tutorial on how to program shaders in general, or how to write HLSL, but rather how to get shaders working in UE4."

I know this is the c++ section, but it seemed like the most logical place to ask

Hey, is that what you’re looking for?

You can actually write hlsl code inside custom nodes!

1 Like