Study/RenderMonkey - 2019년 백업

[RenderMonkey] Globe

김성인 2023. 12. 6. 23:02

[RenderMonkey] Globe


// Vertex Shader

struct VS_INPUT
{
	float4 mPosition : POSITION;
	float2 mTexCoord : TEXCOORD0;
};

struct VS_OUTPUT
{
	float4 mPosition : POSITION;
	float2 mTexCoord : TEXCOORD0;
};

float4x4 gWorldMatrix;
float4x4 gViewMatrix;
float4x4 gProjectionMatrix;

VS_OUTPUT vs_main(VS_INPUT Input)
{
	VS_OUTPUT Output;

	Output.mPosition = mul(Input.mPosition, gWorldMatrix);
	Output.mPosition = mul(Output.mPosition, gViewMatrix);
	Output.mPosition = mul(Output.mPosition, gProjectionMatrix);

	Output.mTexCoord = Input.mTexCoord;

	return Output;
}

// Pixel Shader

sampler2D DiffuseSampler;

struct PS_INPUT
{
	float2 mTexCoord : TEXCOORD0;
};

float4 ps_main(PS_INPUT Input) : COLOR
{
   float4 albedo = tex2D(DiffuseSampler, Input.mTexCoord);
   return albedo.rgba;
}

// Stream Mapping 
// 정점버퍼에서 올바른 UV좌표 값을 불러 오기 위하여 Usage > TEXCOORD, FLOAT2 추가

'Study > RenderMonkey - 2019년 백업' 카테고리의 다른 글

[RenderMonkey] Mapping  (1) 2023.12.06
[RenderMonkey] Specular, ambient  (1) 2023.12.06
[Render Monkey] Phong  (1) 2023.12.06
[RenderMonkey] Diffuse  (1) 2023.12.06
[RenderMonkey] Red Color  (0) 2023.12.06