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...
This commit is contained in:
iDunnoDev
2022-05-04 14:09:59 +01:00
committed by iDunnoDev
parent 7a57c73ac3
commit bc906064e5
15 changed files with 597 additions and 254 deletions

34
Graphics2/ColorGradient.h Normal file
View File

@ -0,0 +1,34 @@
#pragma once
#include <vector>
using namespace std;
// Struct to hold the color data in
typedef struct RGBA {
unsigned int red;
unsigned int green;
unsigned int blue;
unsigned int alpha;
} RGBA;
// Class for dealing with color gradients, mainly for the terrain and blend mapping
class ColorGradient
{
public:
ColorGradient(float min, float max, vector<RGBA> colorSteps);
~ColorGradient();
// Get the RGBA value at the give point
RGBA GetRGBAValue(float inputValue);
private:
float _minValue;
float _maxValue;
// Method for interpolating the color between each step
RGBA Interpolate(RGBA a, RGBA b, float pointValue);
// Vector to hold the color steps in for the gradient
vector<RGBA> _colorSteps;
};