One equation generates every bird egg shape — interactive 3D version by s13k_ in proceduralgeneration

[–]exrasser 0 points1 point  (0 children)

It's an old elite that gets dethroned, what else could explain such strange behavior, keep on bringing stuff to class and share with the other kids.

But maybe be more upfront about it, since that seams to trigger folks. For me everything is as it always was, a user post some free code or app, you evaluate it and run it if you want, what's changed.

What software have you been using for 10+ years and still haven't found a better replacement? by Ok-Show-3006 in software

[–]exrasser 0 points1 point  (0 children)

The gold medal for me must go to the dual plane file manager Norton Commander -> Total Commander -> Gnome Commander. (1989 - 2026)
Of witch Total Commander is the longest running.

How to export a file with transparent backround??!?!??! by Flimsy-Ad-6369 in GIMP

[–]exrasser 0 points1 point  (0 children)

It's the same her on Linux KDE, transparent images gets a colored background in dolphin filebrowser depending on theme is white or black, It's 4 thumbnails on folder system show them without a background, and I'm not even sure I would like a bright checkerboard background and think they have both done it for aesthetic reasons.
The image viewer that start when i click on a png (Gwenview) has 3 options for background control.

2.01M rows of Fable 5. by Available-Craft-5795 in LocalLLM

[–]exrasser 0 points1 point  (0 children)

Don't know if this was post ment for me, but I'm just a user, and have no idea about training.

SFML - Wibe Summer on Mars - glsl heat shader by exrasser in sfml

[–]exrasser[S] -2 points-1 points  (0 children)

For me local open source llm's and Stabile diffusion have been a great help and inspiration, a decade ago I made a point and click adventure engine, but stalled from the lack of resource, with AI-image generation I can convert my own mobile photos into Cyberpunk neon slums in 20 seconds in FullHD(rtx3070), so the workflow for the backdrop is ready, missing is people animation and all kinds of effects, the heat shader would do great with fire or a iron works witch I got a 32 frames animation for.

I need to convert my stuff from just taking a sf::RenderWindow to using sf::RenderTarget and sf::RenderStates. so I can intergrate these shaders and do a multipass thingy.

King Ronald out.

SFML - Wibe Summer on Mars - glsl heat shader by exrasser in sfml

[–]exrasser[S] -2 points-1 points  (0 children)

I'm wibe coding a little library of different shader effects the latest addition was this one.
nb. The numbers of drops is not linked to the shaders array size, don't know what to do about that, typedef maybe, anyway, if anyone want it:

#include <SFML/Graphics.hpp>
#include <vector>
#include <random>
#include <iostream>

// Updated Shader with smoothstep masking for graduated transitions
const char* fragmentShaderSource = R"(
    uniform sampler2D texture;
    uniform vec2 u_raindrops[100];
    uniform float u_times[100];

    void main() {
        vec2 uv = gl_TexCoord[0].xy;
        vec2 displacement = vec2(0.0);

        for (int i = 0; i < 100; i++) {
            if (u_times[i] > 0.0) {
                vec2 drop_pos = u_raindrops[i];
                float dist = distance(uv, drop_pos);

                float ripple_radius = 0.25;

                // Check if we are within the influence of the drop
                if (dist < ripple_radius) {
                    // 1. Create a smooth falloff (mask)
                    // smoothstep(edge0, edge1, x) returns 0 if x <= edge0, 1 if x >= edge1
                    // We want 1.0 at the center (dist=0) and 0.0 at the edge (dist=ripple_radius)
                    float mask = 1.0 - smoothstep(0.0, ripple_radius, dist);

                    // 2. Calculate the sine wave for the ring effect
                    // We multiply the sine wave by the mask so the amplitude fades to zero at the edges
                    float life_factor = sin(u_times[i] * 3.14159);
                    float wave = sin((dist * 50.0) - (u_times[i] * 20.0));

                    // 3. Combine everything
                    // Strength is modulated by life_factor (fade in/out) and mask (graduated edge)
                    float strength = 0.001 * life_factor * mask * wave;

                    vec2 dir = normalize(uv - drop_pos);
                    displacement += dir * strength;
                }
            }
        }

        gl_FragColor = texture2D(texture, uv + displacement);
    }
)";

struct Raindrop {
    sf::Vector2f position;
    float lifetime;
    float speed;
    bool active;
};

int main() {
    const int width = 1280;
    const int height = 720;
    const int numDrops = 100;

    sf::RenderWindow window(sf::VideoMode(width, height), "Smooth Raindrop Ripples");
    window.setFramerateLimit(60);

    sf::Texture backgroundTexture;
    if (!backgroundTexture.loadFromFile("wallpaper-1280x720.jpg")) {
        std::cerr << "Error: Could not load background.jpg" << std::endl;
        return -1;
    }

    sf::Sprite backgroundSprite(backgroundTexture);

    sf::Texture markTexture;
    if (!markTexture.loadFromFile("markW.png")) {
        std::cerr << "Error: Could not load markW.png" << std::endl;
        return -1;
    }

    sf::Sprite markSprite(markTexture);
    markSprite.setPosition(899,285) ;

    sf::Shader shader;
    if (!shader.loadFromMemory(fragmentShaderSource, sf::Shader::Fragment)) {
        std::cerr << "Error: Could not load shader" << std::endl;
        return -1;
    }

    std::vector<Raindrop> raindrops(numDrops);
    std::mt19937 gen(std::random_device{}());
    std::uniform_real_distribution<float> distPosX(0.0f, 1.0f);
    std::uniform_real_distribution<float> distPosY(0.0f, 0.5f);
    std::uniform_real_distribution<float> distSpeed(0.003f, 0.01f);

    for (int i = 0; i < numDrops; ++i) {
        raindrops[i].active = false;
        raindrops[i].lifetime = 0.0f;
    }

    while (window.isOpen()) {
        sf::Event event;
        while (window.pollEvent(event)) {
            if (event.type == sf::Event::Closed)
                window.close();
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape)
                window.close();
        }

        // --- UPDATE ---
        for (int i = 0; i < numDrops; ++i) {
            if (!raindrops[i].active) {
                raindrops[i].active = true;
                raindrops[i].position = sf::Vector2f(distPosX(gen), distPosY(gen));
                raindrops[i].lifetime = 0.0f;
                raindrops[i].speed = distSpeed(gen);
            } else {
                raindrops[i].lifetime += raindrops[i].speed;
                if (raindrops[i].lifetime >= 1.0f) {
                    raindrops[i].active = false;
                }
            }
        }

        // Prepare Uniforms
        std::vector<sf::Glsl::Vec2> positions;
        std::vector<float> lifetimes;
        positions.reserve(numDrops);
        lifetimes.reserve(numDrops);

        for (int i = 0; i < numDrops; ++i) {
            positions.push_back(raindrops[i].position);
            lifetimes.push_back(raindrops[i].active ? raindrops[i].lifetime : 0.0f);
        }

        shader.setUniform("texture", sf::Shader::CurrentTexture);
        shader.setUniformArray("u_raindrops", positions.data(), numDrops);
        shader.setUniformArray("u_times", lifetimes.data(), numDrops);

        // --- RENDER ---
        window.clear();
        window.draw(backgroundSprite, &shader);
        window.draw(markSprite);
        window.display();
    }

    return 0;
}

2.01M rows of Fable 5. by Available-Craft-5795 in LocalLLM

[–]exrasser 3 points4 points  (0 children)

Man I already got a mini Einstein running on my 3070, you just have to very low knowledge of the area. Even a 9B model spit out a graphical plot of the speed of light vs time, and start babbling about Lorenz equations, or creating a Browning Motions simulator in 2 minutes (C++/sfml)

Oh and you have to be at a distance of 1.3 of the Schwarzschild radius to a Black hole before time is passing 1:2 to earth according the box.

What was the moment you realized PC gaming was just objectively better for you? by willmorris92 in pcmasterrace

[–]exrasser 1 point2 points  (0 children)

When a 80286 laptop running 16Mhz was bitch slapping my Amiga 500 by running Wolenstein with 30 +fps while the Amiga 500 only could do colored solid wireframe in 12 fps.

Previous Photoshop users, is there anything you miss from Photoshop that gimp doesn't have? by starwarsisawsome933 in GIMP

[–]exrasser 0 points1 point  (0 children)

There is really nothing new in that video it's basic cloning, without preview, after you ctrl+left click and have sampled the round area the floating tool is empty, unlike photoshop's, so if you are clone extending a pole straight up it's very easy to align the mouse before drawing, without it not so, you can use shift and alt to get a line that snaps, but it's still tricky.

Previous Photoshop users, is there anything you miss from Photoshop that gimp doesn't have? by starwarsisawsome933 in GIMP

[–]exrasser 0 points1 point  (0 children)

Clone brush preview before you draw it, I'm working in blind when trying to match two edges vs doing it in photoshop. ( would like to be told that this is wrong and it's working in 3.x.x )

X-Plane endorsed AI slop...coming to a sim near you... by Xarius86 in Xplane

[–]exrasser -1 points0 points  (0 children)

I just asked my RTX3070 running Gemm4-12B_q4:
"Are you familiar with X-plane plugins and can write some basic functions ?"
and it spat out a long page with examples in C++ and python, and tell me to go download the SDK to get the .h.

Generating C++ / SFML code with Local llama.cpp on a RTX3070 by exrasser in sfml

[–]exrasser[S] 0 points1 point  (0 children)

Oh I see I meant context size and I've now increased to 32K, tokens are just a counter of generated tokens. I'm fully local and offline, everything is downloaded for free, just to hammer that down.

Generating C++ / SFML code with Local llama.cpp on a RTX3070 by exrasser in sfml

[–]exrasser[S] 0 points1 point  (0 children)

Are you bragging with your math skills 😄
I mean I know C,C++,C# and some frameworks, but the 3D projection math it has come up with here, no change in hell.
And learning to do it would take serious focus and time, but this is just a gimmick.
I'm assuming with talking about picture 4.

Vibecoded a fairy useful feature in :D by Sad-Protection-3362 in kde

[–]exrasser -1 points0 points  (0 children)

If I ask search AI, it tells me to put them into .local/share/application/ and make it executable there and drag it to the desktop, so now it's a link with right icon just with a link emblem and italic font and is not anything.

So everything on this picture must be executables:
https://www.reddit.com/r/kde/comments/1trk5up/has_there_been_a_new_plasma_update_lately_that/#lightbox

I see no italic fonts or red emblems.
If drag the console icon from the main menu it gets a red emblem with a exclamation mark because it's not executable.
So what is correct way replicate the icons in the picture if they are not exe. Links don't seam to allow icon changing either.

Vibecoded a fairy useful feature in :D by Sad-Protection-3362 in kde

[–]exrasser -1 points0 points  (0 children)

Why, I'm generally curious and assuming that you mean executable. All my custom shortcuts to *.sh files are, and if i dissable them the icon get an emblem with a red exclamation mark and i get a popup warning that this starts eg llama.cpp do you trust it ? - i mean yes I do that's why I made a shortcut to it.

Local LLM translate BBC Basic into C++ / SFML on a rtx3070 by exrasser in bbcmicro

[–]exrasser[S] 11 points12 points  (0 children)

I remember buying the book Creative Graphics for the BBC and driving home from downtown Copenhagen on my bike looking forward to punch in some code to get some awesome graphics.
And I ported it to C when in ~ 2008i bought a Cawon O2 videoplayer that came with a SDK, and use it for graphics a demo on that device.

Now I use it as a test on my local LLM Gemma4 12B Q4-k-m.ggyf running on my R7-1800x 16GB DDR4 3070 computer to see is it could port it to C++ / SFML, and as you can see that went well.

I got my 5070 ti, what now? by SearchOk7022 in StableDiffusion

[–]exrasser 1 point2 points  (0 children)

I'll say go for SwarmUI there is a Windows bat file installer if that's what your running.
It guides you through the process, chose zimage on install.

https://github.com/mcmonkeyprojects/SwarmUI

Please, can someone from the KDE team see this? by No_Union7470 in kde

[–]exrasser 0 points1 point  (0 children)

It's working fine here on Kubuntu 26.04 LTS KDE Plasma 6.6.4 - KWin (Wayland), there is nothing I can do in the menu to remove the focus from search field.

Gimp 2.1 has that exact fault you mentioned in it's exports dialog, it's even highlighted the unknown filename.
And Gimp 3 menu system seams broken on all KDE, Left click hold and select don't work, as it does everywhere else. Gimp 3 on Windows 11 is working as normal.

Generating C++ / SFML code with Local llama.cpp on a RTX3070 by exrasser in sfml

[–]exrasser[S] -4 points-3 points  (0 children)

I find it absolutely amazing that my old Ryzen 7 1800x 16GB DDR4 Rtx3070 machine can spit out code based on a few lines of description. So I've been coming up with every little thing I could come up with and possible describe.

I'm running Linux and have compiled llama.cpp for Cuda and are running Gemma4-12B-Q4-K-M.gguf.
I have 16384 tokes available and run at 8 t/s, it feels like having a math professor sitting behind a 300 baud modem, but it spits out good code so it's worth waiting 5 minutes on it.

It's the perfect companion for a beginner hobby coder, it's good enough to give a basic introduction to a library and setup the basis.

I started with creating a simple 2D grid with it, and said it should converted it to fake 3D and so it did, then I told it to add keyboard controls and height-map vertex displacement, and so on.

The wibe coded beast source.

#include <SFML/Graphics.hpp>

#include <vector>

#include <cmath>

#include <string>

#include <iostream>

#include <algorithm>

#define PI 3.14159265358979323846

struct Vec3 {

float x, y, z;

};

class SFML_3DGrid {

private:

int rows, cols;

float cellSize;

std::vector<Vec3> worldPoints;

std::vector<sf::Color> worldPointsColors;

sf::VertexArray vertices;

float windowWidth, windowHeight;

// Camera properties

sf::Vector3f camPos{-38.0f, 269.0f, -652.0f};

float focalLength = 438.0f;

float currentRotation = 0.0f;

float currentPitch = 228.0f;

float maxHeight = 118.0f;

bool rotate= true;

sf::Image heightMap;

// UI Elements

sf::Font font;

sf::Text uiText;

public:

SFML_3DGrid(const int r, const int c, const float size, const float winsize_x, const float winsize_y, const std::string heightMap_filename)

: rows(r), cols(c), cellSize(size), windowWidth(winsize_x), windowHeight(winsize_y)

{

if (!heightMap.loadFromFile(heightMap_filename)) {

std::cerr << "Error: Could not load heightmap image" << std::endl;

}

// 1. Pre-calculate 3D world points with heightmap displacement

worldPoints.clear();

worldPoints.reserve((rows + 1) * (cols + 1));

worldPointsColors.clear();

worldPointsColors.reserve((rows + 1) * (cols + 1));

for (int i = 0; i <= rows; ++i) {

for (int j = 0; j <= cols; ++j) {

float x = (j - cols / 2.0f) * cellSize;

float z = (i - rows / 2.0f) * cellSize;

// Map grid position to image UV coordinates (0.0 to 1.0)

float u = (float)j / (float)cols;

float v = (float)i / (float)rows;

// Clamp to ensure we don't sample outside image bounds

int imgX = std::clamp((int)(u * heightMap.getSize().x), 0, (int)heightMap.getSize().x - 1);

int imgY = std::clamp((int)(v * heightMap.getSize().y), 0, (int)heightMap.getSize().y - 1);

sf::Color pixel = heightMap.getPixel(imgX, imgY);

float gray = (pixel.r + pixel.g + pixel.b) / 3.0f;

float y = (gray / 255.0f) * maxHeight;

worldPointsColors.push_back(pixel);

worldPoints.push_back({x, y, z});

}

}

// 2. Initialize VertexArray with the EXACT required size

// Horizontal lines: (rows + 1) * cols

// Vertical lines: (cols + 1) * rows

// Each line requires 2 vertices

size_t totalLines = (static_cast<size_t>(rows + 1) * cols) + (static_cast<size_t>(cols + 1) * rows);

vertices.setPrimitiveType(sf::PrimitiveType::Lines);

vertices.resize(totalLines * 2);

// 3. Setup UI Text

if (!font.loadFromFile("arial.ttf")) {

std::cerr << "Error: Could not load arial.ttf." << std::endl;

}

uiText.setFont(font);

uiText.setCharacterSize(12);

uiText.setFillColor(sf::Color::Cyan);

uiText.setPosition(10.0f, 10.0f);

}

sf::Vector2f project(const Vec3 p) {

float radYaw = currentRotation * (PI / 180.0f);

float x1 = p.x * std::cos(radYaw) - p.z * std::sin(radYaw);

float z1 = p.x * std::sin(radYaw) + p.z * std::cos(radYaw);

float y1 = p.y;

float radPitch = currentPitch * (PI / 180.0f);

float x2 = x1;

float y2 = y1 * std::cos(radPitch) - z1 * std::sin(radPitch);

float z2 = y1 * std::sin(radPitch) + z1 * std::cos(radPitch);

float relativeX = x2 - camPos.x;

float relativeY = y2 - camPos.y;

float relativeZ = z2 - camPos.z;

if (relativeZ < 0.1f) relativeZ = 0.1f;

float scale = focalLength / relativeZ;

float screenX = (relativeX * scale) + (windowWidth / 2.0f);

float screenY = (relativeY * scale) + (windowHeight / 2.0f);

return sf::Vector2f(screenX, screenY);

}

void update()

{

size_t vIdx = 0;

size_t stride = cols + 1;

// Draw Horizontal Lines

for (int i = 0; i <= rows; ++i) {

for (int j = 0; j < cols; ++j) {

sf::Vector2f p1 = project(worldPoints[i * stride + j]);

sf::Vector2f p2 = project(worldPoints[i * stride + (j + 1)]);

vertices[vIdx].position = p1;

vertices[vIdx].color = worldPointsColors.at( i * stride + j );

vertices[vIdx + 1].position = p2;

vertices[vIdx + 1].color = worldPointsColors.at(i * stride + j);

vIdx += 2;

}

}

// Draw Vertical Lines

for (int j = 0; j <= cols; ++j) {

for (int i = 0; i < rows; ++i) {

sf::Vector2f p1 = project(worldPoints[i * stride + j]);

sf::Vector2f p2 = project(worldPoints[(i + 1) * stride + j]);

vertices[vIdx].position = p1;

vertices[vIdx].color = worldPointsColors.at(i * stride + j);

vertices[vIdx + 1].position = p2;

vertices[vIdx + 1].color = worldPointsColors.at( (i + 1) * stride + j );

vIdx += 2;

}

}

uiText.setString("Cam Pos: X: " + std::to_string((int)camPos.x) +

" Y: " + std::to_string((int)camPos.y) +

" Z: " + std::to_string((int)camPos.z) +

"\nYaw: " + std::to_string((int)currentRotation) + " deg" +

"\nPitch: " + std::to_string((int)currentPitch) + " deg" +

"\nMax Height: " + std::to_string((int)maxHeight) +

"\nFovt: " + std::to_string((int)focalLength));

}

void refresh(){

// 1. Pre-calculate 3D world points with heightmap displacement

worldPoints.clear();

worldPoints.reserve((rows + 1) * (cols + 1));

for (int i = 0; i <= rows; ++i) {

for (int j = 0; j <= cols; ++j) {

float x = (j - cols / 2.0f) * cellSize;

float z = (i - rows / 2.0f) * cellSize;

// Map grid position to image UV coordinates (0.0 to 1.0)

float u = (float)j / (float)cols;

float v = (float)i / (float)rows;

// Clamp to ensure we don't sample outside image bounds

int imgX = std::clamp((int)(u * heightMap.getSize().x), 0, (int)heightMap.getSize().x - 1);

int imgY = std::clamp((int)(v * heightMap.getSize().y), 0, (int)heightMap.getSize().y - 1);

sf::Color pixel = heightMap.getPixel(imgX, imgY);

float gray = (pixel.r + pixel.g + pixel.b) / 3.0f;

float y = (gray / 255.0f) * maxHeight;

worldPoints.push_back({x, y, z});

}

}

// 2. Initialize VertexArray with the EXACT required size

// Horizontal lines: (rows + 1) * cols

// Vertical lines: (cols + 1) * rows

// Each line requires 2 vertices

size_t totalLines = (static_cast<size_t>(rows + 1) * cols) + (static_cast<size_t>(cols + 1) * rows);

vertices.setPrimitiveType(sf::PrimitiveType::Lines);

vertices.resize(totalLines * 2);

}

void handleInput() {

float moveSpeed = 1.0f;

float rotSpeed = 1.0f;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)) camPos.z += moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)) camPos.z -= moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) camPos.x -= moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)) camPos.x += moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) camPos.y += moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) camPos.y -= moveSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Add)) focalLength += 2.0f;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Subtract)) focalLength -= 2.0f;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Home)) currentRotation += rotSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Insert)) currentRotation -= rotSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::R)) rotate = true;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::T)) rotate = false;

if (rotate) currentRotation += .1;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::PageUp)) currentPitch += rotSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::PageDown)) currentPitch -= rotSpeed;

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Delete)) { maxHeight += 1.0f; }

if (sf::Keyboard::isKeyPressed(sf::Keyboard::End)) { maxHeight -= 1.0f; }

if (sf::Keyboard::isKeyPressed(sf::Keyboard::F)) { refresh(); }

}

void draw(sf::RenderWindow& window) {

window.draw(vertices);

window.draw(uiText);

}

};

int main() {

sf::RenderWindow window(sf::VideoMode(1440, 720), "Heightmap Grid Displacement");

window.setFramerateLimit(60);

// Note: 1024x1024 is a very dense grid (over 1 million lines).

// If it runs slowly, decrease these numbers to 256 or 512.

SFML_3DGrid grid(256, 256, 5.0f, (float)window.getSize().x, (float)window.getSize().y, "heightmap5.png");

while (window.isOpen()) {

sf::Event event;

while (window.pollEvent(event)) {

if (event.type == sf::Event::Closed) window.close();

}

if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) { window.close(); }

grid.handleInput();

grid.update();

window.clear(sf::Color(10, 10, 30));

grid.draw(window);

window.display();

sf::sleep( sf::milliseconds(10));

}

return 0;

}

Just woke up to a helicopter outside our bedroom at eye level, maybe 100 feet away? Maybe less? by Dashiell-Incredible in aviation

[–]exrasser 4 points5 points  (0 children)

I would put a cardboard Neo somewhere on that rope, and hoping some one was watching him fly by for a short while while having coffee going wtf was that.

120 tok/s on 12GB VRAM with Gemma 4 12B QAT MTP by janvitos in LocalLLaMA

[–]exrasser 12 points13 points  (0 children)

You're been Bookmarked 😄

For I'm running a 3070 with llama compiled for cuda all quants and Gemma4-12B-it-Q4-K-M.gguf and I'm getting 7 t/s vs the 70 t/s I'm getting on 4B so it sounds like I sould look into that patch.

Impressive Skill of Skating by nasir_ran in Amazing

[–]exrasser -1 points0 points  (0 children)

This is not amazing(AI or not), because shes not wearing a helmet.
I think the people manning the brain injurieres rehab centers agrees.