Page 1 of 1

HLSL Vertex Textures in V5

Posted: 27 Jun 2016, 12:58
by hummerbaendiger
Hi,

I was wondering how to use vertex textures in HLSL shaders in V5... In V4 you were able to define the texture stage as Vertex1 or Vertex2.
Was this changed to the displacement map stage (would make most sense)? I tried with this code snippet, but it looks like the texture isn't sampled at all (no displacement):

float4x4 WorldViewProjection : WORLDVIEWPROJECTION;

sampler Vertex1 : register(s0);
float lod=0;

// Vertex shader program input
struct VS_INPUT
{
float4 Position : POSITION;
float4 Texcoord : TEXCOORD0;

};

// Vertex shader program output
struct VS_OUTPUT
{
float4 Position : POSITION;
float4 Texcoord : TEXCOORD0;
};


// Vertex Shader Program

VS_OUTPUT VS( VS_INPUT Input )
{
VS_OUTPUT Output;

Output.Texcoord = Input.Texcoord;
float4 displace = tex2Dlod(Vertex1,float4(Input.Texcoord.xy,0,lod));
Output.Position = mul(Input.Position + displace, WorldViewProjection);

return Output;
}

Also the option to explicitly define the texture stage has gone as well with the new material system. Or is there any way to define or overwrite one specific stage?

Thanks for any hints, Flo

Re: HLSL Vertex Textures in V5

Posted: 29 Jun 2016, 12:38
by lerou
Would be nice to get the answer.

Until then: Copy paste the old nodes from V4 ;)

Re: HLSL Vertex Textures in V5

Posted: 29 Jun 2016, 13:16
by Dennis
Hey..
I forwarded the issue already to our specialist.. he is out of the office for some days and will reply asap :)

All the best
Dee

(Typos from mobile)

Re: HLSL Vertex Textures in V5

Posted: 23 Sep 2016, 09:32
by neuston
Is there any update from the specialist?

Re: HLSL Vertex Textures in V5

Posted: 26 Sep 2016, 09:52
by Dierk Ohlerich
yes, Copy paste the old nodes from V4 is the way to do it for now.