Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

alrighty, thank you for taking the time to answer!
and take your time working on it if you need.

Ok so~ open "composite.frag"


On line 27:

void main(void) {

    vec4 color = texture2D(uSampler, vTextureCoord);

Add this under vec4 color:

vec4 basexx = texture2D(uSampler, vTextureCoord);


Next,  scroll down to the bottom where you see:

    gl_FragColor = color;

   
}
Replace the gl_FragColor = color with the following:

gl_FragColor = mix(color, basexx, 0.5);

From here, just edit the "0.5" value until you get a result you like <3

sorry to bother, i made the edits, unfortunately it doesn't seem anything happened so i might be doing something wrong, im thinking it might be something with the .frag files as i've never used these before, am i supposed to include the .frag files along the rest of the .js files in the plugin folder, or do i have to activate em somehow or place em somewhere else?

You dont need to apologize~ So basically, I forgot that I only included the frag / vert files so people can read how they work, but I actually packed the contents
in superRetroPlus.js~ replace the line on 272:

var compositeFragSource = **big a* code line here lol**
With this one:


const mixValue = 0.5;
var compositeFragSource = `varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform float delta;
uniform float canvasWidth;
uniform float canvasHeight;
uniform float positionX;
uniform float positionY;
uniform float signal;
uniform float sync;
uniform float scanlines;
uniform bool enabled;
uniform bool interlacing;
uniform vec2 texsize;
uniform float checker_size;
float checker(vec2 uv, float repeats) {
float cx = floor(repeats * uv.x);
float cy = floor(repeats * uv.y); float result = mod(cx + cy, 2.0);
return sign(result);
} void main(void) {
vec4 color = texture2D(uSampler, vTextureCoord); if(sync != 0.0) {
for(float i=0.0;i<0.0005;i+=0.00006) {
for(float j=-0.0003;j<0.0003;j+=0.0003) {
vec4 colCopy = texture2D(uSampler, vTextureCoord);
color = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.t+sin(gl_FragCoord.t / sync)));
}
}
} if(interlacing == true) {
vec4 lineDown = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.t+(0.78539816345 / (canvasHeight * 2.0))));
vec4 lineUp = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.t-(0.78539816345 / (canvasHeight * 2.0))));
float checkFor = cos(gl_FragCoord.y+(delta*2.0));
if(checkFor >= (3.1415926538 / 4.0)) {
color = lineDown / 4.0;
} else {
color = lineUp / 4.0;
} color *= 4.0;
}
if(enabled == true) {
vec4 color2 = texture2D(uSampler, vTextureCoord); float result = (cos(gl_FragCoord.s*3.1415926538) + sin(gl_FragCoord.t*3.1415926539)) / 1.0;
color2.r /= (result+cos(delta) / 32.0);
color2.g /= result;
color2.b /= result; color.r += cos(delta/1.1+cos(delta))*(color2.r / 7.0);
color.g += cos(-delta+cos(delta))*(color2.g / 7.0);
color.b += cos(delta+cos(delta))*(color2.b / 7.0);
color.r+=cos(gl_FragCoord.x * 2.0) / 32.0;
color /= 1.33;
color.b /= 1.15;
for(float i=0.0;i<0.0005;i+=0.00006) {
for(float j=-0.0003;j<0.0003;j+=0.0003) {
color += (texture2D(uSampler, vec2(vTextureCoord.x+i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color -= (texture2D(uSampler, vec2(vTextureCoord.x+(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color.g *= 1.001;
color += (texture2D(uSampler, vec2(vTextureCoord.x-i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color -= (texture2D(uSampler, vec2(vTextureCoord.x-(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color.g /= 1.001;
color += (texture2D(uSampler, vec2(vTextureCoord.x+i/1.90, vTextureCoord.y-(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color -= (texture2D(uSampler, vec2(vTextureCoord.x+(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 4.0 - (signal / 1000.0);
color.b *= 1.001;
color += (texture2D(uSampler, vec2(vTextureCoord.x-i/1.80, vTextureCoord.y-(j/3.1415926538)))) / 5.0;
color -= (texture2D(uSampler, vec2(vTextureCoord.x-(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 5.0;
color.b /= 1.001;
color.r *= 1.0015;
color += (texture2D(uSampler, vec2(vTextureCoord.x-i/1.91, vTextureCoord.y-(j/3.1415926538)))) / 8.0;
color -= (texture2D(uSampler, vec2(vTextureCoord.x-(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 8.0; color.r /= 1.001;
}
} if(signal >= 1.0) {
for(float i=0.0;i<0.0005;i+=0.00006) {
for(float j=-0.0003;j<0.0003;j+=0.0003) {
color += (texture2D(uSampler, vec2((sin(delta*signal))+vTextureCoord.x+i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((cos(delta*signal))+vTextureCoord.x+(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color.g *= 1.001;
color += (texture2D(uSampler, vec2((cos(delta*signal))+vTextureCoord.x-i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((sin(delta*signal))+vTextureCoord.x-(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color.g /= 1.001;
color += (texture2D(uSampler, vec2((sin(delta*signal))+vTextureCoord.x+i/1.90, vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((cos(delta*signal))+vTextureCoord.x+(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color.b *= 1.001;
color += (texture2D(uSampler, vec2((cos(delta*signal))+vTextureCoord.x-i/1.80, vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((sin(delta*signal))+vTextureCoord.x-(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color.b /= 1.001; color += (texture2D(uSampler, vec2((sin(delta*signal))-vTextureCoord.x+i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((cos(delta*signal))-vTextureCoord.x+(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color.g *= 1.001;
color += (texture2D(uSampler, vec2((cos(delta*signal))-vTextureCoord.x-i/1.90, vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((sin(delta*signal))-vTextureCoord.x-(i/3.1415926538), vTextureCoord.y+(j/3.1415926538)))) / 77.0 - signal;
color.g /= 1.001;
color += (texture2D(uSampler, vec2((sin(delta*signal))-vTextureCoord.x+i/1.90, vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((cos(delta*signal))-vTextureCoord.x+(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color.b *= 1.001;
color += (texture2D(uSampler, vec2((cos(delta*signal))-vTextureCoord.x-i/1.80, vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color -= (texture2D(uSampler, vec2((sin(delta*signal))-vTextureCoord.x-(i/2.0), vTextureCoord.y-(j/3.1415926538)))) / 77.0 - signal;
color.b /= 1.001; }
}
}
}
if(scanlines > 0.0) {
color -= sin(vTextureCoord.t * (canvasHeight * 1.5)) / (100.0 - scanlines);
} gl_FragColor = mix(color, texture2D(uSampler, vTextureCoord), ${mixValue});
}`;

Basically just delete the original compositeFragSource var, and paste all of the code block there in~
Now just edit mixValue (If this doesnt work I'll get more hands on and we can use discord)

sorry for the late answer, got busy with work but yeah this works very nicely, i can now retain more of the color, i was just wondering if i could increase the intensity of the blur while retaining more color, while messing with it i was very happy with the colors on the parameter while it was at 0.7 but i liked the blur of 0.3, i was wondering if messing with just some of the values could i just increase it a bit to get the blur i want while having it at 0.7?

sorry if it's been too much to ask, it just gets so close to nailing the look i want that im making sure im happy with it before moving with the rest of the stuff lol

Bruh your answers are on time compared to me, my answers are slower than a -- well lets not go there~
"

it just gets so close to nailing the look i want that im making sure im happy with it before moving with the rest of the stuff lol"
My guy, I'm genuinely happy you have this kind of mindset, it means you have legit potential to become a coder yourself, and a very good one, persistence on a problem is what drives me as well, I spend like 2 months on a dumb issue with Linux Kernel code and trying to write a custom driver for some hardware, not because I found it fun (at first I did), but because I didnt want to move on until I conquered that b* lol

I have in fact moved on without conquering it but Ill be back, lol
"

was wondering if messing with just some of the values could i just increase it a bit to get the blur i want while having it at 0.7?"
Yep, from here you can share the code with GPT or Gemini and they will help you better understand my packed spaghetti code lol

alright noted!

seriously thank you so much for your help, your plugin was just close to perfect as i wanted and im glad i got to have your help to complete the look of my game given how im very much an artist and not much of a programmer/scripter. I'll be sure to provide a copy of the game as thanks when it's all and done, though honestly that might take a year or two lol.

Sweet, looking forward to it :)

Also, worry not my friend; the whole "good at one thing and one thing only" is a myth, I'm also good at cooking! *provides burn af crusty fish
:)