added gradient shaders to triangle primative
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../datatypes.cpp"
|
||||
#include "../helpers.cpp"
|
||||
@@ -47,17 +48,8 @@ namespace UwU {
|
||||
|
||||
} else if (shader.shaderType == HGRADIENT) {
|
||||
// find left-right boundaries
|
||||
uint16_t leftmost, rightmost;
|
||||
if (xl0 < xl1) {
|
||||
leftmost = xl0;
|
||||
} else {
|
||||
leftmost = xl1;
|
||||
}
|
||||
if (xr0 > xr1) {
|
||||
rightmost = xr0;
|
||||
} else {
|
||||
rightmost = xr1;
|
||||
}
|
||||
uint16_t leftmost = std::min(xl0, xl1);
|
||||
uint16_t rightmost = std::max(xr0, xr1);
|
||||
|
||||
// precompute gradient LUT
|
||||
Color cols[rightmost - leftmost];
|
||||
|
||||
Reference in New Issue
Block a user