Files
directx-plane-game/Graphics2/SharedMethods.h
iDunnoDev bc906064e5 Added color gradient for the terrain blend maps
Added terrainBuffer struct
Added shared methods to genereate random UV's and intensities
Added water to the terrain
Added random UV's to the shader
Removed the vector3d class since DX can deal with that stuff...
2022-05-04 14:09:59 +01:00

49 lines
1.0 KiB
C++

#pragma once
#include "DirectXFramework.h"
struct CBUFFER
{
XMMATRIX completeTransformation;
XMMATRIX worldTransformation;
XMFLOAT4 cameraPosition;
XMVECTOR lightVector;
XMFLOAT4 lightColor;
XMFLOAT4 ambientColor;
XMFLOAT4 diffuseCoefficient;
XMFLOAT4 specularCoefficient;
float shininess;
float opacity;
float padding[2];
};
struct TCBUFFER
{
XMMATRIX completeTransformation;
XMMATRIX worldTransformation;
XMFLOAT4 cameraPosition;
XMVECTOR lightVector;
XMFLOAT4 lightColor;
XMFLOAT4 ambientColor;
XMFLOAT4 diffuseCoefficient;
XMFLOAT4 specularCoefficient;
float shininess;
float opacity;
float waterHeight;
float waterShininess;
XMFLOAT4 waterColor;
float padding[4];
};
namespace SharedMethods
{
XMMATRIX RotateFromPoint(float x, float y, float z, XMMATRIX rotationMatrix);
float RGBValueToIntensity(int value);
float Lerp(int a, int b, int p);
float Lerp(float a, float b, float p);
float GenerateRandomIntensity(float min, float max);
float GenerateRandomUV(int min, int max);
};