nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
fixed_function_approximation_shader.h
1#ifndef NXDK_PGRAPH_TESTS_SRC_SHADERS_FIXED_FUNCTION_APPROXIMATION_SHADER_H_
2#define NXDK_PGRAPH_TESTS_SRC_SHADERS_FIXED_FUNCTION_APPROXIMATION_SHADER_H_
3
4#include "shaders/perspective_vertex_shader.h"
5#include "xbox_math_matrix.h"
6
7using namespace XboxMath;
8
10class FixedFunctionApproximationShader : public PBKitPlusPlus::PerspectiveVertexShader {
11 public:
12 FixedFunctionApproximationShader(uint32_t framebuffer_width, uint32_t framebuffer_height, float z_min = 0,
13 float z_max = 0x7FFF, float fov_y = M_PI * 0.25f, float near = 1.0f,
14 float far = 10.0f);
15
17 void SetDirectionalLightDirection(const vector_t &direction);
18
20 void SetDirectionalLightCastDirection(const vector_t &direction);
21
22 protected:
23 int OnLoadConstants() override;
24
25 private:
26 vector_t light_direction_ = {0, 0, 1, 1};
27};
28
29#endif // NXDK_PGRAPH_TESTS_SRC_SHADERS_FIXED_FUNCTION_APPROXIMATION_SHADER_H_
Programmable vertex shader that mimicks the behavior of the fixed function pipeline.
Definition fixed_function_approximation_shader.h:10
void SetDirectionalLightCastDirection(const vector_t &direction)
Sets the direction in which the directional light is casting light.
Definition fixed_function_approximation_shader.cpp:21
void SetDirectionalLightDirection(const vector_t &direction)
Sets the direction from the origin towards the directional light.
Definition fixed_function_approximation_shader.cpp:17