Update shader for android

This commit is contained in:
2025-02-15 22:34:24 +01:00
parent e020784f4f
commit 1994e7ccb1
8 changed files with 143 additions and 153 deletions

View File

@@ -52,7 +52,6 @@ void BackGround::deinit()
void BackGround::draw(Dna *dna)
{
Circle::setSoftEdge(true);
m_dna = dna;
mountenSeed = dna->mountenSeed;
starSeed = dna->starSeed;

View File

@@ -6,11 +6,7 @@
RenderTexture2D Circle::target;
Shader Circle::shader;
float Circle::radius;
float Circle::start_transperency;
float Circle::c[3];
int Circle::radius_loc;
int Circle::start_transperency_loc;
int Circle::colorLoc;
void Circle::init()
@@ -22,14 +18,6 @@ void Circle::init()
#endif
target = LoadRenderTexture(sizeTexute, sizeTexute);
radius = 0.6f;
radius_loc = GetShaderLocation(shader, "sun_radius");
SetShaderValue(shader, radius_loc, &radius, SHADER_UNIFORM_FLOAT);
start_transperency = 0.40f;
start_transperency_loc = GetShaderLocation(shader, "start_transperency");
SetShaderValue(shader, start_transperency_loc, &start_transperency, SHADER_UNIFORM_FLOAT);
c[0] = 1.0f;
c[1] = 1.0f;
c[2] = 1.0f;
@@ -55,19 +43,6 @@ void Circle::setColor(Color color)
SetShaderValue(shader, colorLoc, c, SHADER_UNIFORM_VEC3);
}
void Circle::setSoftEdge(bool soft)
{
if (soft)
{
radius = 0.6f;
}
else
{
radius = 1.0f;
}
SetShaderValue(shader, radius_loc, &radius, SHADER_UNIFORM_FLOAT);
}
void Circle::draw(float x, float y, float size)
{
Rectangle dest = {x - size, y - size, size * 2, size * 2};

View File

@@ -1,7 +1,6 @@
#include <cmath>
#include "canvas/Tree.hpp"
#include "canvas/Circle.hpp"
#include <raylib.h>
#include <raymath.h>
@@ -45,8 +44,6 @@ void Tree::init(int size)
void Tree::draw(Dna *dna)
{
Circle::setSoftEdge(false);
m_dna = dna;
branchSeed = dna->branchSeed;
drawCalls.push_back({start, 180.0f, 0});