Files
directx-plane-game/Graphics2/ColorGradient.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

35 lines
723 B
C++

#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;
};