Fix idle preset and filters, load logo textures y-flipped.

Idle preset doesn't render the same way as before, as it was presumably adapted to projectM's previous math. It's now a bit more complex, with the M tilting, a sine waveform at the bottom and some other tweaks.

The filter mesh was broken, so the effects didn't render at all.
This commit is contained in:
Kai Blaschke
2023-03-29 20:33:36 +02:00
parent 75fe0f0ede
commit 74bd99a46f
6 changed files with 253 additions and 236 deletions

View File

@ -91,7 +91,7 @@ void CustomShape::Initialize(PresetFileParser& parsedFile, int index)
m_border_a = parsedFile.GetFloat(shapecodePrefix + "border_a", m_border_a);
// projectM addition: texture name to use for rendering the shape
m_image = parsedFile.GetString("image", "");
m_image = parsedFile.GetString(shapecodePrefix + "image", "");
}
void CustomShape::CompileCodeAndRunInitExpressions()
@ -175,7 +175,7 @@ void CustomShape::Draw()
if (static_cast<int>(*m_perFrameContext.textured) != 0)
{
m_presetState.texturedShader.Bind();
m_presetState.texturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjection);
m_presetState.texturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjectionFlipped);
m_presetState.texturedShader.SetUniformInt("texture_sampler", 0);
// Textured shape, either main texture or texture from "image" key
@ -210,7 +210,7 @@ void CustomShape::Draw()
const float angle = cornerProgress * pi * 2.0f + static_cast<float>(*m_perFrameContext.tex_ang) + pi * 0.25f;
vertexData[i].u = 0.5f + 0.5f * cosf(angle) / static_cast<float>(*m_perFrameContext.tex_zoom) * textureAspectY;
vertexData[i].v = 0.5f + 0.5f * sinf(angle) / static_cast<float>(*m_perFrameContext.tex_zoom);
vertexData[i].v = 0.5f - 0.5f * sinf(angle) / static_cast<float>(*m_perFrameContext.tex_zoom);
}
vertexData[sides + 1] = vertexData[1];
@ -234,7 +234,7 @@ void CustomShape::Draw()
glBufferData(GL_ARRAY_BUFFER, sizeof(TexturedPoint) * (sides + 2), vertexData.data(), GL_DYNAMIC_DRAW);
m_presetState.untexturedShader.Bind();
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjection);
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjectionFlipped);
glBindVertexArray(m_vaoIdUntextured);
glDrawArrays(GL_TRIANGLE_FAN, 0, sides + 2);
@ -252,7 +252,7 @@ void CustomShape::Draw()
}
m_presetState.untexturedShader.Bind();
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjection);
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjectionFlipped);
glVertexAttrib4f(1,
static_cast<float>(*m_perFrameContext.border_r),

View File

@ -183,7 +183,7 @@ void CustomWaveform::Draw(const PerFrameContext& presetPerFrameContext)
}
m_presetState.untexturedShader.Bind();
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjection);
m_presetState.untexturedShader.SetUniformMat4x4("vertex_transformation", PresetState::orthogonalProjectionFlipped);
auto iterations = (m_drawThick && !m_useDots) ? 4 : 1;

View File

@ -11,8 +11,23 @@ Filters::Filters(const PresetState& presetState)
RenderItem::Init();
}
void Filters::InitVertexAttrib()
{
glEnableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(Point), reinterpret_cast<void*>(offsetof(Point, x)));
}
void Filters::Draw()
{
UpdateMesh();
if (m_viewportWidth == 0 || m_viewportHeight == 0)
{
return;
}
glEnable(GL_BLEND);
m_presetState.untexturedShader.Bind();
@ -46,12 +61,50 @@ void Filters::Draw()
}
void Filters::InitVertexAttrib()
void Filters::Brighten()
{
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBlendFunc(GL_ZERO, GL_DST_COLOR);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
void Filters::Darken()
{
glBlendFunc(GL_ZERO, GL_DST_COLOR);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
void Filters::Solarize()
{
glBlendFunc(GL_ZERO, GL_ONE_MINUS_DST_COLOR);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBlendFunc(GL_DST_COLOR, GL_ONE);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
void Filters::Invert()
{
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
void Filters::UpdateMesh()
{
if (m_viewportWidth == m_presetState.renderContext.viewportSizeX &&
m_viewportHeight == m_presetState.renderContext.viewportSizeY)
{
return;
}
m_viewportWidth = m_presetState.renderContext.viewportSizeX;
m_viewportHeight = m_presetState.renderContext.viewportSizeY;
std::array<RenderItem::Point, 4> points;
float const fOnePlusInvWidth = 1.0f + 1.0f / static_cast<float>(m_presetState.renderContext.viewportSizeX);
float const fOnePlusInvHeight = 1.0f + 1.0f / static_cast<float>(m_presetState.renderContext.viewportSizeY);
float const fOnePlusInvWidth = 1.0f + 1.0f / static_cast<float>(m_viewportWidth);
float const fOnePlusInvHeight = 1.0f + 1.0f / static_cast<float>(m_viewportHeight);
points[0].x = -fOnePlusInvWidth;
points[1].x = fOnePlusInvWidth;
points[2].x = -fOnePlusInvWidth;
@ -61,39 +114,9 @@ void Filters::InitVertexAttrib()
points[2].y = -fOnePlusInvHeight;
points[3].y = -fOnePlusInvHeight;
glEnableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(Point), reinterpret_cast<void*>(offsetof(Point, x)));
glBindVertexArray(m_vaoID);
glBindBuffer(GL_ARRAY_BUFFER, m_vboID);
glBufferData(GL_ARRAY_BUFFER, sizeof(points), points.data(), GL_STATIC_DRAW);
}
void Filters::Brighten()
{
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBlendFunc(GL_ZERO, GL_DST_COLOR);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
void Filters::Darken()
{
glBlendFunc(GL_ZERO, GL_DST_COLOR);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
void Filters::Solarize()
{
glBlendFunc(GL_ZERO, GL_ONE_MINUS_DST_COLOR);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBlendFunc(GL_DST_COLOR, GL_ONE);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
void Filters::Invert()
{
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}

View File

@ -21,6 +21,8 @@ public:
void Draw();
private:
void UpdateMesh();
/**
* @brief Brightens the image.
*/
@ -42,4 +44,7 @@ private:
void Invert();
const PresetState& m_presetState; //!< The global preset state.
int m_viewportWidth{}; //!< Last known viewport width
int m_viewportHeight{}; //!< Last known viewport height
};

View File

@ -6,197 +6,186 @@
// Original preset name: "Geiss & Sperl - Feedback (projectM idle HDR mix).milk"
std::string IdlePresets::presetText()
{
std::ostringstream out;
out << "[preset00]\n"
<< "fRating=2.000000\n"
<< "fGammaAdj=1.700000\n"
<< "fDecay=0.940000\n"
<< "fVideoEchoZoom=1.000000\n"
<< "fVideoEchoAlpha=0.000000\n"
<< "nVideoEchoOrientation=0\n"
<< "nWaveMode=0\n"
<< "bAdditiveWaves=1\n"
<< "bWaveDots=0\n"
<< "bWaveThick=0\n"
<< "bModWaveAlphaByVolume=0\n"
<< "bMaximizeWaveColor=0\n"
<< "bTexWrap=1\n"
<< "bDarkenCenter=0\n"
<< "bRedBlueStereo=0\n"
<< "bBrighten=0\n"
<< "bDarken=0\n"
<< "bSolarize=0\n"
<< "bInvert=0\n"
<< "fWaveAlpha=0.001000\n"
<< "fWaveScale=0.010000\n"
<< "fWaveSmoothing=0.630000\n"
<< "fWaveParam=-1.000000\n"
<< "fModWaveAlphaStart=0.710000\n"
<< "fModWaveAlphaEnd=1.300000\n"
<< "fWarpAnimSpeed=1.000000\n"
<< "fWarpScale=1.331000\n"
<< "fZoomExponent=1.000000\n"
<< "fShader=0.000000\n"
<< "zoom=13.290894\n"
<< "rot=-0.020000\n"
<< "cx=0.500000\n"
<< "cy=0.500000\n"
<< "dx=-0.280000\n"
<< "dy=-0.320000\n"
<< "warp=0.010000\n"
<< "sx=1.000000\n"
<< "sy=1.000000\n"
<< "wave_r=0.650000\n"
<< "wave_g=0.650000\n"
<< "wave_b=0.650000\n"
<< "wave_x=0.500000\n"
<< "wave_y=0.500000\n"
<< "ob_size=0.000000\n"
<< "ob_r=0.010000\n"
<< "ob_g=0.000000\n"
<< "ob_b=0.000000\n"
<< "ob_a=1.000000\n"
<< "ib_size=0.000000\n"
<< "ib_r=0.950000\n"
<< "ib_g=0.850000\n"
<< "ib_b=0.650000\n"
<< "ib_a=1.000000\n"
<< "nMotionVectorsX=64.000000\n"
<< "nMotionVectorsY=0.000000\n"
<< "mv_dx=0.000000\n"
<< "mv_dy=0.000000\n"
<< "mv_l=0.900000\n"
<< "mv_r=1.000000\n"
<< "mv_g=1.000000\n"
<< "mv_b=1.000000\n"
<< "mv_a=0.000000\n"
<< "shapecode_3_enabled=1\n"
<< "shapecode_3_sides=4\n"
<< "shapecode_3_additive=0\n"
<< "shapecode_3_thickOutline=0\n"
<< "shapecode_3_textured=1\n"
<< "shapecode_3_image=idlem\n"
<< "shapecode_3_x=0.68\n"
<< "shapecode_3_y=0.5\n"
<< "shapecode_3_rad=0.41222\n"
<< "shapecode_3_ang=0\n"
<< "shapecode_3_tex_ang=0\n"
<< "shapecode_3_tex_zoom=0.5\n"
<< "shapecode_3_r=1\n"
<< "shapecode_3_g=1\n"
<< "shapecode_3_b=1\n"
<< "shapecode_3_a=1\n"
<< "shapecode_3_r2=1\n"
<< "shapecode_3_g2=1\n"
<< "shapecode_3_b2=1\n"
<< "shapecode_3_a2=1\n"
<< "shapecode_3_border_r=0\n"
<< "shapecode_3_border_g=0\n"
<< "shapecode_3_border_b=0\n"
<< "shapecode_3_border_a=0\n"
<< "shape_3_per_frame1=x = x + q1;\n"
<< "shape_3_per_frame2=y = y + q2;\n"
<< "shape_3_per_frame3=r =0.5 + 0.5*sin(q8*0.613 + 1);\n"
<< "shape_3_per_frame4=g = 0.5 + 0.5*sin(q8*0.763 + 2);\n"
<< "shape_3_per_frame5=b = 0.5 + 0.5*sin(q8*0.771 + 5);\n"
<< "shape_3_per_frame6=r2 = 0.5 + 0.5*sin(q8*0.635 + 4);\n"
<< "shape_3_per_frame7=g2 = 0.5 + 0.5*sin(q8*0.616+ 1);\n"
<< "shape_3_per_frame8=b2 = 0.5 + 0.5*sin(q8*0.538 + 3);\n"
<< "shapecode_4_enabled=1\n"
<< "shapecode_4_sides=4\n"
<< "shapecode_4_additive=0\n"
<< "shapecode_4_thickOutline=0\n"
<< "shapecode_4_textured=1\n"
<< "shapecode_4_image=idleheadphones\n"
<< "shapecode_4_x=0.68\n"
<< "shapecode_4_y=0.58\n"
<< "shapecode_4_rad=0.6\n"
<< "shapecode_4_ang=0\n"
<< "shapecode_4_tex_ang=0\n"
<< "shapecode_4_tex_zoom=0.5\n"
<< "shapecode_4_r=1\n"
<< "shapecode_4_g=1\n"
<< "shapecode_4_b=1\n"
<< "shapecode_4_a=1\n"
<< "shapecode_4_r2=1\n"
<< "shapecode_4_g2=1\n"
<< "shapecode_4_b2=1\n"
<< "shapecode_4_a2=1\n"
<< "shapecode_4_border_r=0\n"
<< "shapecode_4_border_g=0\n"
<< "shapecode_4_border_b=0\n"
<< "shapecode_4_border_a=0\n"
<< "shape_4_per_frame1=x = x + q1;\n"
<< "shape_4_per_frame2=y = y + q2;\n"
<< "shape_4_per_frame3=rad = rad + bass * 0.1;\n"
<< "shape_4_per_frame4=a = q3;\n"
<< "shape_4_per_frame5=a2 = q3;\n"
<<
// disabling projectM logo thingey
// "shapecode_6_enabled=1\n" <<
// "shapecode_6_sides=4\n" <<
// "shapecode_6_additive=0\n" <<
// "shapecode_6_thickOutline=0\n" <<
// "shapecode_6_textured=1\n" <<
// "shapecode_6_image=project.tga\n" <<
// "shapecode_6_x=0.38\n" <<
// "shapecode_6_y=0.435\n" <<
// "shapecode_6_rad=0.8\n" <<
// "shapecode_6_ang=0\n" <<
// "shapecode_6_tex_ang=0\n" <<
// "shapecode_6_tex_zoom=0.5\n" <<
// "shapecode_6_r=1\n" <<
// "shapecode_6_g=1\n" <<
// "shapecode_6_b=1\n" <<
// "shapecode_6_a=1\n" <<
// "shapecode_6_r2=1\n" <<
// "shapecode_6_g2=1\n" <<
// "shapecode_6_b2=1\n" <<
// "shapecode_6_a2=1\n" <<
// "shapecode_6_border_r=0\n" <<
// "shapecode_6_border_g=0\n" <<
// "shapecode_6_border_b=0\n" <<
// "shapecode_6_border_a=0\n" <<
// "shape_6_per_frame1=x = x + q1;\n" <<
// "shape_6_per_frame2=y = y + q2;\n" <<
// "shape_6_per_frame3=a = q3;\n" <<
// "shape_6_per_frame4=a2 = q3;\n" <<
"per_frame_1=ob_r = 0.5 + 0.4*sin(time*1.324);\n"
<< "per_frame_2=ob_g = 0.5 + 0.4*cos(time*1.371);\n"
<< "per_frame_3=ob_b = 0.5+0.4*sin(2.332*time);\n"
<< "per_frame_4=ib_r = 0.5 + 0.25*sin(time*1.424);\n"
<< "per_frame_5=ib_g = 0.25 + 0.25*cos(time*1.871);\n"
<< "per_frame_6=ib_b = 1-ob_b;\n"
<< "per_frame_7=volume = 0.15*(bass+bass_att+treb+treb_att+mid+mid_att);\n"
<< "per_frame_8=xamptarg = if(equal(frame%15,0),min(0.5*volume*bass_att,0.5),xamptarg);\n"
<< "per_frame_9=xamp = xamp + 0.5*(xamptarg-xamp);\n"
<< "per_frame_10=xdir = if(above(abs(xpos),xamp),-sign(xpos),if(below(abs(xspeed),0.1),2*above(xpos,0)-1,xdir));\n"
<< "per_frame_11=xaccel = xdir*xamp - xpos - xspeed*0.055*below(abs(xpos),xamp);\n"
<< "per_frame_12=xspeed = xspeed + xdir*xamp - xpos - xspeed*0.055*below(abs(xpos),xamp);\n"
<< "per_frame_13=xpos = xpos + 0.001*xspeed;\n"
<< "per_frame_14=dx = xpos*0.05;\n"
<< "per_frame_15=yamptarg = if(equal(frame%15,0),min(0.3*volume*treb_att,0.5),yamptarg);\n"
<< "per_frame_16=yamp = yamp + 0.5*(yamptarg-yamp);\n"
<< "per_frame_17=ydir = if(above(abs(ypos),yamp),-sign(ypos),if(below(abs(yspeed),0.1),2*above(ypos,0)-1,ydir));\n"
<< "per_frame_18=yaccel = ydir*yamp - ypos - yspeed*0.055*below(abs(ypos),yamp);\n"
<< "per_frame_19=yspeed = yspeed + ydir*yamp - ypos - yspeed*0.055*below(abs(ypos),yamp);\n"
<< "per_frame_20=ypos = ypos + 0.001*yspeed;\n"
<< "per_frame_21=dy = ypos*0.05;\n"
<< "per_frame_22=wave_a = 0;\n"
<< "per_frame_23=q8 = oldq8 + 0.0003*(pow(1+1.2*bass+0.4*bass_att+0.1*treb+0.1*treb_att+0.1*mid+0.1*mid_att,6)/fps);\n"
<< "per_frame_24=oldq8 = q8;\n"
<< "per_frame_25=q7 = 0.003*(pow(1+1.2*bass+0.4*bass_att+0.1*treb+0.1*treb_att+0.1*mid+0.1*mid_att,6)/fps);\n"
<< "per_frame_26=rot = 0.4 + 1.5*sin(time*0.273) + 0.4*sin(time*0.379+3);\n"
<< "per_frame_27=q1 = 0.05*sin(time*1.14);\n"
<< "per_frame_28=q2 = 0.03*sin(time*0.93+2);\n"
<< "per_frame_29=q3 = if(above(frame,60),1, frame/60.0);\n"
<< "per_frame_30=oldq8 = if(above(oldq8,1000),0,oldq8);\n"
<< "per_pixel_1=zoom =( log(sqrt(2)-rad) -0.24)*1;\n";
return out.str();
{ return R"([preset00]
fRating=2.000000
fGammaAdj=1.700000
fDecay=0.940000
fVideoEchoZoom=1.025000
fVideoEchoAlpha=0.100000
nVideoEchoOrientation=0
nWaveMode=6
bAdditiveWaves=1
bWaveDots=0
bWaveThick=1
bModWaveAlphaByVolume=0
bMaximizeWaveColor=0
bTexWrap=1
bDarkenCenter=0
bRedBlueStereo=0
bBrighten=0
bDarken=0
bSolarize=0
bInvert=0
fWaveAlpha=0.000000
fWaveScale=0.100000
fWaveSmoothing=0.630000
fWaveParam=0.000000
fModWaveAlphaStart=1.00000
fModWaveAlphaEnd=1.000000
fWarpAnimSpeed=1.000000
fWarpScale=1.331000
fZoomExponent=1.000000
fShader=0.000000
zoom=1.000000
rot=-0.020000
cx=0.500000
cy=0.500000
dx=-0.280000
dy=-0.320000
warp=0.010000
sx=1.000000
sy=1.000000
wave_r=1.000000
wave_g=1.000000
wave_b=1.000000
wave_x=0.100000
wave_y=0.500000
ob_size=0.010000
ob_r=0.010000
ob_g=0.000000
ob_b=0.000000
ob_a=1.000000
ib_size=0.010000
ib_r=0.950000
ib_g=0.850000
ib_b=0.650000
ib_a=1.000000
nMotionVectorsX=64.000000
nMotionVectorsY=0.000000
mv_dx=0.000000
mv_dy=0.000000
mv_l=0.900000
mv_r=1.000000
mv_g=1.000000
mv_b=1.000000
mv_a=0.000000
shapecode_0_enabled=1
shapecode_0_sides=4
shapecode_0_additive=0
shapecode_0_thickOutline=0
shapecode_0_textured=1
shapecode_0_image=idlem
shapecode_0_x=0.5
shapecode_0_y=0.5
shapecode_0_rad=0.41222
shapecode_0_ang=0
shapecode_0_tex_ang=0
shapecode_0_tex_zoom=0.707106781186
shapecode_0_r=1
shapecode_0_g=1
shapecode_0_b=1
shapecode_0_a=1
shapecode_0_r2=1
shapecode_0_g2=1
shapecode_0_b2=1
shapecode_0_a2=1
shapecode_0_border_r=0
shapecode_0_border_g=0
shapecode_0_border_b=0
shapecode_0_border_a=0
shape_0_per_frame1=x = x + q1;
shape_0_per_frame2=y = y + q2;
shape_0_per_frame3=r =0.5 + 0.5*sin(q8*0.613 + 1);
shape_0_per_frame4=g = 0.5 + 0.5*sin(q8*0.763 + 2);
shape_0_per_frame5=b = 0.5 + 0.5*sin(q8*0.771 + 5);
shape_0_per_frame6=r2 = 0.5 + 0.5*sin(q8*0.635 + 4);
shape_0_per_frame7=g2 = 0.5 + 0.5*sin(q8*0.616+ 1);
shape_0_per_frame8=b2 = 0.5 + 0.5*sin(q8*0.538 + 3);
shape_0_per_frame9=ang = q10;
shapecode_1_enabled=1
shapecode_1_sides=4
shapecode_1_additive=0
shapecode_1_thickOutline=0
shapecode_1_textured=1
shapecode_1_image=idleheadphones
shapecode_1_x=0.5
shapecode_1_y=0.5
shapecode_1_rad=0.6
shapecode_1_ang=0
shapecode_1_tex_ang=0
shapecode_1_tex_zoom=0.707106781186
shapecode_1_r=1
shapecode_1_g=1
shapecode_1_b=1
shapecode_1_a=1
shapecode_1_r2=1
shapecode_1_g2=1
shapecode_1_b2=1
shapecode_1_a2=1
shapecode_1_border_r=0
shapecode_1_border_g=0
shapecode_1_border_b=0
shapecode_1_border_a=0
shape_1_per_frame1=ang = q10;
shape_1_per_frame2=x = x + q1 + sin(q10) * q9 * rad;
shape_1_per_frame3=y = y + q2 + cos(q10) * q9;
shape_1_per_frame4=rad = rad + bass * 0.1;
shape_1_per_frame5=a = q3;
shape_1_per_frame6=a2 = q3;
wavecode_0_enabled=1
wavecode_0_bDrawThick=1
wavecode_0_bSpectrum=0
wavecode_0_bAdditive=1
wavecode_0_samples=480
wavecode_0_scaling=1.000000
wavecode_0_smoothing=0.0
wavecode_0_r=1.0
wavecode_0_g=0.0
wavecode_0_b=0.0
wavecode_0_a=1.0
wave_0_per_point1=y = sin((sample * 2 * $PI + time)) * (sin(time) * 0.05 + 0.025) + 0.3 + value1 / 2;
wave_0_per_point2=x = sample;
wave_0_per_point3=r = 0.5 + 0.5*sin(q8*0.613 + 1);
wave_0_per_point4=g = 0.5 + 0.5*sin(q8*0.763 + 2);
wave_0_per_point5=b = 0.5 + 0.5*sin(q8*0.771 + 5);
wave_0_per_point6=
wave_0_per_point7=
per_frame_1=ob_r = 0.5 + 0.4*sin(time*1.324);
per_frame_2=ob_g = 0.5 + 0.4*cos(time*1.371);
per_frame_3=ob_b = 0.5+0.4*sin(2.332*time);
per_frame_4=ib_r = 0.5 + 0.25*sin(time*1.424); wave_r = ib_r;
per_frame_5=ib_g = 0.25 + 0.25*cos(time*1.871); wave_g = ib_g;
per_frame_6=ib_b = 1-ob_b; wave_b = ib_b;
per_frame_7=volume = 0.15*(bass+bass_att+treb+treb_att+mid+mid_att);
per_frame_8=xamptarg = if(equal(frame%15,0),min(0.5*volume*bass_att,0.5),xamptarg);
per_frame_9=xamp = xamp + 0.5*(xamptarg-xamp);
per_frame_10=xdir = if(above(abs(xpos),xamp),-sign(xpos),if(below(abs(xspeed),0.1),2*above(xpos,0)-1,xdir));
per_frame_11=xaccel = xdir*xamp - xpos - xspeed*0.055*below(abs(xpos),xamp);
per_frame_12=xspeed = xspeed + xdir*xamp - xpos - xspeed*0.055*below(abs(xpos),xamp);
per_frame_13=xpos = xpos + 0.001*xspeed;
per_frame_14=dx = xpos*0.05;
per_frame_15=yamptarg = if(equal(frame%15,0),min(0.3*volume*treb_att,0.5),yamptarg);
per_frame_16=yamp = yamp + 0.5*(yamptarg-yamp);
per_frame_17=ydir = if(above(abs(ypos),yamp),-sign(ypos),if(below(abs(yspeed),0.1),2*above(ypos,0)-1,ydir));
per_frame_18=yaccel = ydir*yamp - ypos - yspeed*0.055*below(abs(ypos),yamp);
per_frame_19=yspeed = yspeed + ydir*yamp - ypos - yspeed*0.055*below(abs(ypos),yamp);
per_frame_20=ypos = ypos + 0.001*yspeed;
per_frame_21=dy = ypos*0.05;
per_frame_22=q5 = aspecty;
per_frame_23=q8 = oldq8 + 0.0003*(pow(1+1.2*bass+0.4*bass_att+0.1*treb+0.1*treb_att+0.1*mid+0.1*mid_att,6)/fps);
per_frame_24=oldq8 = q8;
per_frame_25=q7 = 0.003*(pow(1+1.2*bass+0.4*bass_att+0.1*treb+0.1*treb_att+0.1*mid+0.1*mid_att,6)/fps);
per_frame_26=rot = 0.4 + 1.5*sin(time*0.273) + 0.4*sin(time*0.379+3);
per_frame_27=q1 = 0.2*sin(time*1.14);
per_frame_28=q2 = 0.15*sin(time*0.93+2); wave_x = 0.58 - q2;
per_frame_29=q3 = if(above(frame,60),1, frame/60.0);
per_frame_30=oldq8 = if(above(oldq8,1000),0,oldq8);
per_frame_31=cx = cx + 0.3 * (0.6 * sin(0.245 * time) + 0.4 * sin(0.123 * time));
per_frame_31=cy = cy + 0.3 * (0.6 * sin(0.263 * time) + 0.4 * sin(0.117 * time));
per_frame_32=q9 = 0.12; // Headphones Y offset
per_frame_33=q10 = 0.5 * sin(time * 0.5623); // Logo tilt
per_pixel_1=zoom = log(sqrt(sin(time * .5) * 0.5 + 2.5) - .5 * rad) + 0.4;
)";
}
std::unique_ptr<Preset>

View File

@ -66,7 +66,7 @@ void TextureManager::Preload()
M_bytes,
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
SOIL_FLAG_INVERT_Y | SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
auto newTex = std::make_shared<Texture>("idlem", tex, GL_TEXTURE_2D, width, height, false);
@ -77,7 +77,7 @@ void TextureManager::Preload()
headphones_bytes,
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
SOIL_FLAG_INVERT_Y | SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
newTex = std::make_shared<Texture>("idleheadphones", tex, GL_TEXTURE_2D, width, height, false);
m_textures["idleheadphones"] = newTex;