Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleG committed Nov 20, 2024
1 parent 48a83a0 commit 2ab8188
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 1 files
+3 −3 init.lua
8 changes: 7 additions & 1 deletion assets/shader/focus.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

extern highp float time;

const float MAX_ITERATIONS = 100.0;

float hash(vec2 p)
{
float h = dot(p, vec2(127.1, 311.7));
Expand Down Expand Up @@ -33,8 +35,12 @@ float perlinNoise(vec2 p, float iteration)
{
float outValue = 0.0;

for (float i = 0.0; i < iteration; i += 1.0)
for (float i = 0.0; i < MAX_ITERATIONS; i += 1.0)
{
if (i >= iteration)
{
break;
}
float freq = pow(2.0, i);
float Amp = 1.0 / freq;

Expand Down
8 changes: 7 additions & 1 deletion assets/shader/fog.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

extern highp float time;

const float MAX_ITERATIONS = 100.0;

float rand3d(vec3 co, float seed)
{
return sin(fract((sin(dot(co, vec3(30.233 * seed, 7.233 * seed, 20.2352 * seed)))) * 815150.5453) * 321.321);
Expand Down Expand Up @@ -45,8 +47,12 @@ float Noise3d(vec3 pos, float size, float seed)
float perlinNoise3d(vec3 pos, float size, float seed, float iteration)
{
float r = 0.0;
for (float i = 0.0; i < iteration; i++)
for (float i = 0.0; i < MAX_ITERATIONS; i++)
{
if (i >= iteration)
{
break;
}
float freq = pow(2.0, i);
r += Noise3d(pos, size * freq, seed) * (1.0 / freq);
}
Expand Down
14 changes: 12 additions & 2 deletions assets/shader/gaussianBlur.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
extern float smpCount; // 10
extern float radius; // 0.026

const float MAX_ITERATIONS = 100.0;

vec4 effect(vec4 color, sampler2D tex, vec2 texCoord, vec2 scrCoord) {
vec4 res = vec4(0.0, 0.0, 0.0, 0.0);
float weightSum = 0.0;

for (float x = 0.0; x < smpCount; x++) {
for (float y = 0.0; y < smpCount; y++) {
for (float x = 0.0; x < MAX_ITERATIONS; x++) {
if (x >= smpCount)
{
break;
}
for (float y = 0.0; y < MAX_ITERATIONS; y++) {
if (y >= smpCount)
{
break;
}
vec2 kuvCentered = vec2(x, y) / smpCount - 0.5; // uv coord within the kernel

float bell = cos(length(kuvCentered) * 3.141592653589793) * 0.5 + 0.5;
Expand Down
14 changes: 12 additions & 2 deletions assets/shader/gaussianSharp.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ extern float smpCount; // 10
extern float radius; // 0.026
extern float intensity; // 1

const float MAX_ITERATIONS = 100.0;

vec4 effect(vec4 color, sampler2D tex, vec2 texCoord, vec2 scrCoord) {
vec4 normal = texture2D(tex, texCoord);
vec4 res = vec4(0.0);
float weightSum = 0.0;

for (float x = 0.0; x < smpCount; x++) {
for (float y = 0.0; y < smpCount; y++) {
for (float x = 0.0; x < MAX_ITERATIONS; x++) {
if (x >= smpCount)
{
break;
}
for (float y = 0.0; y < MAX_ITERATIONS; y++) {
if (y >= smpCount)
{
break;
}
vec2 kuvCentered = vec2(x, y) / smpCount - 0.5; // uv coord within the kernel

float bell = cos(length(kuvCentered) * 3.141592653589793) * 0.5 + 0.5;
Expand Down
14 changes: 7 additions & 7 deletions conf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ function love.conf(t)

local fs=love.filesystem
fs.setIdentity(identity)
do -- Load grapgic settings from conf/settings
local fileData=fs.read('conf/settings')
if fileData then
msaa=tonumber(fileData:match('"msaa":(%d+)')) or 0
portrait=mobile and fileData:find('"portrait":true') and true
end
end
-- do -- Load grapgic settings from conf/settings
-- local fileData=fs.read('conf/settings')
-- if fileData then
-- msaa=tonumber(fileData:match('"msaa":(%d+)')) or 0
-- portrait=mobile and fileData:find('"portrait":true') and true
-- end
-- end

t.identity='Techmino_Galaxy' -- Saving folder
t.externalstorage=true -- Use external storage on Android
Expand Down

0 comments on commit 2ab8188

Please sign in to comment.