Hello,
i try to rebuild a simple shader example from AMD's RenderMonkey. I need therefor two matrixes, WORLDVIEWPROJECTION & VIEW, but it seems that only one matrix at the time is possible. See the attached pic... Or do i something wrong?
joschy
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
HLSL Matrix
Moderator: Support
Re: HLSL Matrix
ok, i got it, but...
[// Vertex shader program output
struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float color: TEXCOORD1;
};
// Vertex Shader Program
VS_OUTPUT VS(float4 Pos: POSITION )
{
VS_OUTPUT Output;
float3 pos;
// Billboard the quads.
// The view matrix gives us our right and up vectors.
pos = 5 * Pos.z * (Pos.x * View_matrix[0]+ Pos.y * View_matrix[1]);
// Transform the vertex from 3D object space to 2D screen space.
Output.Pos = mul(float4(pos, 1), WorldViewProjection);
//Output.Pos = mul(Pos, WorldViewProjection);
Output.texCoord = Pos.xy;
Output.color = Pos.z;
return Output;
}
]
The poly should face to the view, but it doesn't. Any suggestions why? Pic from the RenderMonky screen attached.
joschy
[// Vertex shader program output
struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float color: TEXCOORD1;
};
// Vertex Shader Program
VS_OUTPUT VS(float4 Pos: POSITION )
{
VS_OUTPUT Output;
float3 pos;
// Billboard the quads.
// The view matrix gives us our right and up vectors.
pos = 5 * Pos.z * (Pos.x * View_matrix[0]+ Pos.y * View_matrix[1]);
// Transform the vertex from 3D object space to 2D screen space.
Output.Pos = mul(float4(pos, 1), WorldViewProjection);
//Output.Pos = mul(Pos, WorldViewProjection);
Output.texCoord = Pos.xy;
Output.color = Pos.z;
return Output;
}
]
The poly should face to the view, but it doesn't. Any suggestions why? Pic from the RenderMonky screen attached.
joschy
3DJo - [Ventuz] freelancer and trainer
Re: HLSL Matrix
mmmhh, it seems that these line is different calculated:
[pos = 15 * Pos.z * (Pos.x * view_matrix[0] + Pos.y * view_matrix[1]);]
[pos = 15 * Pos.z * (Pos.x * view_matrix[0] + Pos.y * view_matrix[1]);]
3DJo - [Ventuz] freelancer and trainer
Re: HLSL Matrix
I´ve reduced all the VS stuff and compare it again. RenderMonkey uses Dotproduct operations where Ventuz uses mul & mad operations, interesting..
3DJo - [Ventuz] freelancer and trainer
Re: HLSL Matrix
it works, have to have the right orientation of the mesh
cheers, joschy
cheers, joschy
3DJo - [Ventuz] freelancer and trainer