このブログを検索

170412C++DirectX12カメラの配置と三角形のZ軸回転 - shaders.hlsl

shaders.hlsl
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

cbuffer SceneConstantBuffer : register(b0)
{
float4x4 world;
float4x4 view;
float4x4 projection;
};

struct PSInput
{
float4 position : SV_POSITION;
float4 color : COLOR;
};

PSInput VSMain(float4 position : POSITION, float4 color : COLOR)
{
PSInput result;

result.position = mul(world, position);
result.position = mul(view, result.position);
result.position = mul(projection, result.position);
result.color = color;

return result;
}

float4 PSMain(PSInput input) : SV_TARGET
{
return input.color;
}

0 件のコメント:

コメントを投稿