mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-05 09:25:40 +00:00
Fix native presets
This commit is contained in:
@ -34,3 +34,11 @@ libRovastarDarkSecret_la_LDFLAGS = -avoid-version
|
||||
libRovastarDriftingChaos_la_LDFLAGS = -avoid-version
|
||||
libRovastarFractalSpiral_la_LDFLAGS = -avoid-version
|
||||
libRovastarFractopiaFrantic_la_LDFLAGS = -avoid-version
|
||||
|
||||
|
||||
libMstressJuppyDancer_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
libRLGFractalDrop7c_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
libRovastarDarkSecret_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
libRovastarDriftingChaos_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
libRovastarFractalSpiral_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
libRovastarFractopiaFrantic_la_LIBADD = ../libprojectM/libprojectM.la
|
||||
|
||||
@ -28,7 +28,7 @@ void Brighten::Draw(RenderContext &context)
|
||||
{
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glBindVertexArray(m_vaoID);
|
||||
|
||||
@ -61,7 +61,7 @@ void Darken::Draw(RenderContext &context)
|
||||
{
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
@ -92,7 +92,7 @@ void Invert::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
@ -122,7 +122,7 @@ void Solarize::Draw(RenderContext &context)
|
||||
{
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glVertexAttrib4f(1, 1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ void MilkdropWaveform::Draw(RenderContext &context)
|
||||
mat_vertex = mat_scale * mat_vertex;
|
||||
mat_vertex = mat_rotation * mat_vertex;
|
||||
mat_vertex = mat_second_translation * mat_vertex;
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(mat_vertex));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(mat_vertex));
|
||||
|
||||
if(modulateAlphaByVolume) ModulateOpacityByVolume(context);
|
||||
else temp_a = a;
|
||||
|
||||
@ -72,7 +72,7 @@ void DarkenCenter::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glBindVertexArray(m_vaoID);
|
||||
|
||||
@ -224,8 +224,8 @@ void Shape::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f_t2f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniform1i(context.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
|
||||
|
||||
glBindVertexArray(m_vaoID_texture);
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, sides+2);
|
||||
@ -261,7 +261,7 @@ void Shape::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glBindVertexArray(m_vaoID_not_texture);
|
||||
glDrawArrays(GL_TRIANGLE_FAN,0,sides+2);
|
||||
@ -287,7 +287,7 @@ void Shape::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glVertexAttrib4f(1, border_r, border_g, border_b, border_a * masterAlpha);
|
||||
|
||||
@ -350,7 +350,7 @@ void MotionVectors::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
#ifndef GL_TRANSITION
|
||||
if (length <= 0.0) {
|
||||
@ -360,7 +360,7 @@ void MotionVectors::Draw(RenderContext &context)
|
||||
}
|
||||
#endif
|
||||
|
||||
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), length);
|
||||
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, length);
|
||||
glVertexAttrib4f(1, r, g, b, a * masterAlpha);
|
||||
|
||||
glBindVertexArray(m_vaoID);
|
||||
@ -409,7 +409,7 @@ void Border::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
glVertexAttrib4f(1, outer_r, outer_g, outer_b, outer_a * masterAlpha);
|
||||
|
||||
|
||||
@ -20,6 +20,10 @@ public:
|
||||
TextureManager *textureManager;
|
||||
GLuint programID_v2f_c4f;
|
||||
GLuint programID_v2f_c4f_t2f;
|
||||
GLint uniform_v2f_c4f_vertex_tranformation;
|
||||
GLint uniform_v2f_c4f_vertex_point_size;
|
||||
GLint uniform_v2f_c4f_t2f_vertex_tranformation;
|
||||
GLint uniform_v2f_c4f_t2f_frag_texture_sampler;
|
||||
glm::mat4 mat_ortho;
|
||||
|
||||
RenderContext();
|
||||
|
||||
@ -109,6 +109,11 @@ Renderer::Renderer(int width, int height, int gx, int gy, BeatDetect *_beatDetec
|
||||
renderContext.programID_v2f_c4f = shaderEngine.programID_v2f_c4f;
|
||||
renderContext.programID_v2f_c4f_t2f = shaderEngine.programID_v2f_c4f_t2f;
|
||||
|
||||
renderContext.uniform_v2f_c4f_vertex_tranformation = shaderEngine.uniform_v2f_c4f_vertex_tranformation;
|
||||
renderContext.uniform_v2f_c4f_vertex_point_size = shaderEngine.uniform_v2f_c4f_vertex_point_size;
|
||||
renderContext.uniform_v2f_c4f_t2f_vertex_tranformation = shaderEngine.uniform_v2f_c4f_t2f_vertex_tranformation;
|
||||
renderContext.uniform_v2f_c4f_t2f_frag_texture_sampler = shaderEngine.uniform_v2f_c4f_t2f_frag_texture_sampler;
|
||||
|
||||
// Interpolation VAO/VBO's
|
||||
glGenBuffers(1, &m_vbo_Interpolation);
|
||||
glGenVertexArrays(1, &m_vao_Interpolation);
|
||||
@ -757,8 +762,8 @@ void Renderer::CompositeOutput(const Pipeline &pipeline, const PipelineContext &
|
||||
|
||||
shaderEngine.enableCompositeShader(currentPipe->compositeShader, pipeline, pipelineContext);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(renderContext.mat_ortho));
|
||||
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
|
||||
glUniformMatrix4fv(shaderEngine.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(renderContext.mat_ortho));
|
||||
glUniform1i(shaderEngine.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
|
||||
|
||||
//Overwrite anything on the screen
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
|
||||
@ -394,13 +394,6 @@ std::string blur2_frag(
|
||||
|
||||
|
||||
|
||||
GLint ShaderEngine::UNIFORM_V2F_C4F_VERTEX_TRANFORMATION = 0;
|
||||
GLint ShaderEngine::UNIFORM_V2F_C4F_VERTEX_POINT_SIZE = 0;
|
||||
GLint ShaderEngine::UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION = 0;
|
||||
GLint ShaderEngine::UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER = 0;
|
||||
|
||||
|
||||
|
||||
ShaderEngine::ShaderEngine() : presetCompShaderLoaded(false), presetWarpShaderLoaded(false)
|
||||
{
|
||||
programID_v2f_c4f = CompileShaderProgram(v2f_c4f_vert, v2f_c4f_frag, "v2f_c4f");
|
||||
@ -409,10 +402,10 @@ ShaderEngine::ShaderEngine() : presetCompShaderLoaded(false), presetWarpShaderLo
|
||||
programID_blur1 = CompileShaderProgram(blur_vert, blur1_frag, "blur1");
|
||||
programID_blur2 = CompileShaderProgram(blur_vert, blur2_frag, "blur2");
|
||||
|
||||
UNIFORM_V2F_C4F_VERTEX_TRANFORMATION = glGetUniformLocation(programID_v2f_c4f, "vertex_transformation");
|
||||
UNIFORM_V2F_C4F_VERTEX_POINT_SIZE = glGetUniformLocation(programID_v2f_c4f, "vertex_point_size");
|
||||
UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION = glGetUniformLocation(programID_v2f_c4f_t2f, "vertex_transformation");
|
||||
UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER = glGetUniformLocation(programID_v2f_c4f_t2f, "texture_sampler");
|
||||
uniform_v2f_c4f_vertex_tranformation = glGetUniformLocation(programID_v2f_c4f, "vertex_transformation");
|
||||
uniform_v2f_c4f_vertex_point_size = glGetUniformLocation(programID_v2f_c4f, "vertex_point_size");
|
||||
uniform_v2f_c4f_t2f_vertex_tranformation = glGetUniformLocation(programID_v2f_c4f_t2f, "vertex_transformation");
|
||||
uniform_v2f_c4f_t2f_frag_texture_sampler = glGetUniformLocation(programID_v2f_c4f_t2f, "texture_sampler");
|
||||
|
||||
uniform_blur1_sampler = glGetUniformLocation(programID_blur1, "texture_sampler");
|
||||
uniform_blur1_c0 = glGetUniformLocation(programID_blur1, "_c0");
|
||||
@ -1302,8 +1295,8 @@ bool ShaderEngine::enableWarpShader(Shader &shader, const Pipeline &pipeline, co
|
||||
|
||||
glUseProgram(programID_v2f_c4f_t2f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(mat_ortho));
|
||||
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
|
||||
glUniformMatrix4fv(uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(mat_ortho));
|
||||
glUniform1i(uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -49,14 +49,15 @@ public:
|
||||
static bool checkCompileStatus(GLuint shader, const std::string & shaderTitle);
|
||||
static bool linkProgram(GLuint programID);
|
||||
|
||||
static GLint Uniform_V2F_C4F_VertexTranformation() { return UNIFORM_V2F_C4F_VERTEX_TRANFORMATION; }
|
||||
static GLint Uniform_V2F_C4F_VertexPointSize() { return UNIFORM_V2F_C4F_VERTEX_POINT_SIZE; }
|
||||
static GLint Uniform_V2F_C4F_T2F_VertexTranformation() { return UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION; }
|
||||
static GLint Uniform_V2F_C4F_T2F_FragTextureSampler() { return UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER; }
|
||||
|
||||
GLuint programID_v2f_c4f;
|
||||
GLuint programID_v2f_c4f_t2f;
|
||||
|
||||
GLint uniform_v2f_c4f_vertex_tranformation;
|
||||
GLint uniform_v2f_c4f_vertex_point_size;
|
||||
GLint uniform_v2f_c4f_t2f_vertex_tranformation;
|
||||
GLint uniform_v2f_c4f_t2f_frag_texture_sampler;
|
||||
|
||||
const static std::string v2f_c4f_vert;
|
||||
const static std::string v2f_c4f_frag;
|
||||
const static std::string v2f_c4f_t2f_vert;
|
||||
@ -114,11 +115,6 @@ private:
|
||||
GLuint programID_presetComp, programID_presetWarp;
|
||||
|
||||
bool presetCompShaderLoaded, presetWarpShaderLoaded;
|
||||
|
||||
static GLint UNIFORM_V2F_C4F_VERTEX_TRANFORMATION;
|
||||
static GLint UNIFORM_V2F_C4F_VERTEX_POINT_SIZE;
|
||||
static GLint UNIFORM_V2F_C4F_T2F_VERTEX_TRANFORMATION;
|
||||
static GLint UNIFORM_V2F_C4F_T2F_FRAG_TEXTURE_SAMPLER;
|
||||
};
|
||||
|
||||
#endif /* SHADERENGINE_HPP_ */
|
||||
|
||||
@ -86,8 +86,8 @@ void VideoEcho::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f_t2f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_T2F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniform1i(ShaderEngine::Uniform_V2F_C4F_T2F_FragTextureSampler(), 0);
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_t2f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniform1i(context.uniform_v2f_c4f_t2f_frag_texture_sampler, 0);
|
||||
|
||||
|
||||
//Now Blend the Video Echo
|
||||
|
||||
@ -80,7 +80,7 @@ void Waveform::Draw(RenderContext &context)
|
||||
|
||||
glUseProgram(context.programID_v2f_c4f);
|
||||
|
||||
glUniformMatrix4fv(ShaderEngine::Uniform_V2F_C4F_VertexTranformation(), 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
glUniformMatrix4fv(context.uniform_v2f_c4f_vertex_tranformation, 1, GL_FALSE, glm::value_ptr(context.mat_ortho));
|
||||
|
||||
if (additive) glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
else glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@ -92,14 +92,14 @@ void Waveform::Draw(RenderContext &context)
|
||||
#ifndef GL_TRANSITION
|
||||
glPointSize(context.texsize <= 512 ? 2 : 2*context.texsize/512);
|
||||
#endif
|
||||
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), context.texsize <= 512 ? 2 : 2*context.texsize/512);
|
||||
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, context.texsize <= 512 ? 2 : 2*context.texsize/512);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef GL_TRANSITION
|
||||
glPointSize(context.texsize <= 512 ? 1 : context.texsize/512);
|
||||
#endif
|
||||
glUniform1f(ShaderEngine::Uniform_V2F_C4F_VertexPointSize(), context.texsize <= 512 ? 1 : context.texsize/512);
|
||||
glUniform1f(context.uniform_v2f_c4f_vertex_point_size, context.texsize <= 512 ? 1 : context.texsize/512);
|
||||
}
|
||||
|
||||
glBindVertexArray(m_vaoID);
|
||||
|
||||
Reference in New Issue
Block a user