main: move projection scaling to CPU-side code
This commit is contained in:
parent
9137cba3b4
commit
e1db1bc978
@ -94,7 +94,7 @@ float4 getView(float4x4 view, float4 position)
|
||||
|
||||
float4 getProjection(float4x4 projection, float4 viewPosition)
|
||||
{
|
||||
return mul(projection, viewPosition) * float4(-1, -1, 1, 1);
|
||||
return mul(projection, viewPosition);
|
||||
}
|
||||
|
||||
float2 yf(float2 v)
|
||||
|
||||
@ -44,7 +44,7 @@ VSOutput VSMain(VSInput input)
|
||||
{
|
||||
VSOutput output = (VSOutput)0;
|
||||
float4 Position = float4(input.Position.xyz + input.BlockPosition, 1.0);
|
||||
output.Position = mul(Scene.Projection, mul(Scene.View, Position.xzyw)) * float4(-1, -1, 1, 1);
|
||||
output.Position = mul(Scene.Projection, mul(Scene.View, Position.xzyw));
|
||||
|
||||
float2 textureOffset = float2(input.TextureID % 8, input.TextureID / 8) * 16;
|
||||
output.Texture = float4(yf(input.Texture.xy, 16), textureOffset);
|
||||
|
||||
@ -79,7 +79,7 @@ XMMATRIX currentProjection()
|
||||
float near_z = 0.1;
|
||||
float far_z = 1000.0;
|
||||
XMMATRIX projection = XMMatrixPerspectiveFovLH(fov_angle_y, aspect_ratio, near_z, far_z);
|
||||
return projection;
|
||||
return projection * XMMatrixScaling(-1, -1, 1);
|
||||
}
|
||||
|
||||
XMMATRIX currentView(collada::instance_types::node const & camera_node,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user