
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...
35 lines
723 B
C++
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;
|
|
};
|
|
|