Asking about what has / what will happen to the software renderer?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

CuteAlien wrote: Tue Jan 28, 2025 1:37 pm Quick answer about software renderers: There are 2 of those in Irrlicht- "Software" and "Burningsvideo".

First one was written by Niko (aka the Irrlicht founder). It is no longer under active development, but we'll keep it around as long as it doesn't cause troubles (so far that's the case). It's main use is for quick UI stuff without 3D. So mainly for dialogs before your application starts. It supports a bit 3D, but mainly just enough to show a single 3D model or so. Anything advanced isn't really supported, so don't use it for 3d scenes. I suspect it might also be useful when trying to get Irrlicht running on a new platform as it's likely easier to port than the other software renderer (way less complex).

Burnings video is the software renderer from Thomas Alten. And once in a while he still works on it. And he usually also reacts quickly when we give him any bug reports. And that one is for real 3D. As long as you don't use too much resolution it works pretty well even for some quite advanced stuff. And it also has another feature which I know some (non forum) users like: The colors are more reproducible than with any of the other drivers (like opengl with different drivers you might not get the exact same results on screen). Which can be quite important in some applications (although we never really guaranteed that, so people using it for that live a tiny bit risky...).
O great! I didn't know that about burning video, I had no idea it was a software renderer.... since it offered a good quality of textures, that justifies the FPS reduction if it's the case

Graphics can be precalculated assuming limits, something like view frustum limit and fps limit with Sleep, for example, i have a code in c++98, an animated tetrahedron in 360 degrees, with 512 angle rotation variants and 26 for distance consumes you 16 mb of ram, with 128 angle rotation variant it's like 2 mb of ram, and the CPU consumption is only in reading(like 70 hz), an animated model probably consumes about 300 mb of ram or more, with textures maybe 400 mb, if you limit it to 256 rotation angles it would reduce considerably the weight, like 50 mb, with 128 i think 20 mb, the example code:
(i try this, but sometimes it doesn't work as it should, but with irrlicht I wouldn't have this problem, I would only have to create the double buffer in it)(limited to 66 updates per second)(zoom with righ click to left and right direction, move around with left click) :mrgreen: :mrgreen:

Code: Select all

#include <windows.h>
#include <cmath>
#include <string>

struct Point3D { float x, y, z; };
struct Face { int v1, v2, v3; float depth; }; 

Point3D baseVertices[] = {
    {0.0f, 50.0f, 0.0f},    
    {-50.0f, -50.0f, -50.0f}, 
    {50.0f, -50.0f, -50.0f}, 
    {0.0f, -50.0f, 50.0f}     
};

Face baseFaces[] = {
    {0, 1, 2, 0},
    {0, 2, 3, 0},
    {0, 3, 1, 0},
    {1, 3, 2, 0}
};

int xRot = 0;
int yRot = 0;
float scale = 1.0f;
const float minScale = 0.5f;
const float maxScale = 3.0f;
const int scaleSteps = 26; 


int rotationDetail = 4; // 1: 64, 2: 128, 3: 256, 4: 512
int rotationSteps; 


POINT*** precomputedProjections = NULL; 
Face*** precomputedFaces = NULL;        

void RotatePoint(Point3D& p, int xRot, int yRot) {
    float theta = xRot * 3.14159265f / 180.0f;
    float phi = yRot * 3.14159265f / 180.0f;

    float y = p.y * cos(theta) - p.z * sin(theta);
    float z = p.y * sin(theta) + p.z * cos(theta);
    p.y = y; p.z = z;

    float x = p.x * cos(phi) + z * sin(phi);
    z = -p.x * sin(phi) + z * cos(phi);
    p.x = x; p.z = z;
}

void SortFaces(Face* faces, int count) {
    for (int i = 0; i < count - 1; i++) {
        for (int j = i + 1; j < count; j++) {
            if (faces[i].depth < faces[j].depth) {
                Face temp = faces[i];
                faces[i] = faces[j];
                faces[j] = temp;
            }
        }
    }
}


void PrecomputeRotationsAndScales() {

    rotationSteps = 8 * (1 << rotationDetail); 

    if (precomputedProjections) {
        for (int xStep = 0; xStep < rotationSteps; xStep++) {
            for (int yStep = 0; yStep < rotationSteps; yStep++) {
                delete[] precomputedProjections[xStep][yStep];
            }
            delete[] precomputedProjections[xStep];
        }
        delete[] precomputedProjections;
    }
    if (precomputedFaces) {
        for (int xStep = 0; xStep < rotationSteps; xStep++) {
            delete[] precomputedFaces[xStep];
        }
        delete[] precomputedFaces;
    }

    precomputedProjections = new POINT**[rotationSteps];
    precomputedFaces = new Face**[rotationSteps];
    for (int xStep = 0; xStep < rotationSteps; xStep++) {
        precomputedProjections[xStep] = new POINT*[rotationSteps];
        precomputedFaces[xStep] = new Face*[rotationSteps];
        for (int yStep = 0; yStep < rotationSteps; yStep++) {
            precomputedProjections[xStep][yStep] = new POINT[scaleSteps * 4];
            precomputedFaces[xStep][yStep] = new Face[4];
        }
    }

    for (int xStep = 0; xStep < rotationSteps; xStep++) {
        for (int yStep = 0; yStep < rotationSteps; yStep++) {

            Point3D rotatedVertices[4];
            for (int i = 0; i < 4; i++) {
                rotatedVertices[i] = baseVertices[i];
                RotatePoint(rotatedVertices[i], xStep * (360 / rotationSteps), yStep * (360 / rotationSteps));
            }

            Face faces[4];
            for (int i = 0; i < 4; i++) {
                faces[i] = baseFaces[i];
                faces[i].depth = (rotatedVertices[faces[i].v1].z + rotatedVertices[faces[i].v2].z + rotatedVertices[faces[i].v3].z) / 3.0f;
            }
            SortFaces(faces, 4);
            for (int i = 0; i < 4; i++) {
                precomputedFaces[xStep][yStep][i] = faces[i];
            }

            for (int s = 0; s < scaleSteps; s++) {
                float currentScale = minScale + s * 0.1f;
                for (int i = 0; i < 4; i++) {
                    precomputedProjections[xStep][yStep][s * 4 + i].x = (int)(rotatedVertices[i].x * currentScale);
                    precomputedProjections[xStep][yStep][s * 4 + i].y = (int)(rotatedVertices[i].y * currentScale);
                }
            }
        }
    }
}

void DrawTextOnFace(HDC hdc, POINT* points, const std::string& text, COLORREF color) {

    int centerX = (points[0].x + points[1].x + points[2].x) / 3;
    int centerY = (points[0].y + points[1].y + points[2].y) / 3;

    SetTextColor(hdc, color);
    SetBkMode(hdc, TRANSPARENT);

    TextOut(hdc, centerX - 8, centerY - 8, text.c_str(), text.length());
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
    static int startX, startY;
    static int initialXRot, initialYRot;
    static float initialScale;
    static DWORD lastUpdateTime = 0;

    switch (message) {
    case WM_LBUTTONDOWN:
        startX = LOWORD(lParam);
        startY = HIWORD(lParam);
        initialXRot = xRot;
        initialYRot = yRot;
        SetCapture(hWnd);
        break;

    case WM_RBUTTONDOWN:
        startX = LOWORD(lParam);
        initialScale = scale;
        SetCapture(hWnd);
        break;

    case WM_MOUSEMOVE:
        if (wParam & MK_LBUTTON || wParam & MK_RBUTTON) {
            DWORD currentTime = GetTickCount();
            if (currentTime - lastUpdateTime < 15) break; //1000:15 updates per second
            lastUpdateTime = currentTime;

            if (wParam & MK_LBUTTON) {
                int currentX = LOWORD(lParam);
                int currentY = HIWORD(lParam);
                int deltaX = currentX - startX;
                int deltaY = currentY - startY;

                xRot = initialXRot + (deltaY / 10) * (360 / rotationSteps);
                yRot = initialYRot + (deltaX / 10) * (360 / rotationSteps);

                xRot = (xRot % 360 + 360) % 360;
                yRot = (yRot % 360 + 360) % 360;
            } else if (wParam & MK_RBUTTON) {
                int currentX = LOWORD(lParam);
                int deltaX = currentX - startX;

                scale = initialScale + (deltaX / 10) * 0.1f;
                scale = scale < minScale ? minScale : scale;
                scale = scale > maxScale ? maxScale : scale;
            }

            InvalidateRect(hWnd, NULL, FALSE); 
        }
        break;

    case WM_LBUTTONUP:
    case WM_RBUTTONUP:
        ReleaseCapture();
        break;

    case WM_PAINT: {
        PAINTSTRUCT ps;
        HDC hdc = BeginPaint(hWnd, &ps);
        RECT rect;
        GetClientRect(hWnd, &rect);
        int width = rect.right - rect.left;
        int height = rect.bottom - rect.top;
        int centerX = width / 2;
        int centerY = height / 2;


        HDC memDC = CreateCompatibleDC(hdc);
        HBITMAP memBM = CreateCompatibleBitmap(hdc, width, height);
        HBITMAP oldBM = (HBITMAP)SelectObject(memDC, memBM);


        HBRUSH hWhiteBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);
        FillRect(memDC, &rect, hWhiteBrush);


        int xStep = xRot / (360 / rotationSteps);
        int yStep = yRot / (360 / rotationSteps);
        int sStep = (int)((scale - minScale) / 0.1f);


        HPEN hBlackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
        HBRUSH hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
        HPEN oldPen = (HPEN)SelectObject(memDC, hBlackPen);
        HBRUSH oldBrush = (HBRUSH)SelectObject(memDC, hBlueBrush);

        for (int i = 0; i < 4; i++) {
            POINT projected[3];
            projected[0].x = centerX + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v1].x;
            projected[0].y = centerY + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v1].y;
            projected[1].x = centerX + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v2].x;
            projected[1].y = centerY + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v2].y;
            projected[2].x = centerX + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v3].x;
            projected[2].y = centerY + precomputedProjections[xStep][yStep][sStep * 4 + precomputedFaces[xStep][yStep][i].v3].y;
            Polygon(memDC, projected, 3);

            if (i < 3) {
                COLORREF colors[] = { RGB(255, 0, 0), RGB(0, 255, 0), RGB(255, 255, 0) };
                DrawTextOnFace(memDC, projected, ":)", colors[i]);
            }
        }

        BitBlt(hdc, 0, 0, width, height, memDC, 0, 0, SRCCOPY);

        SelectObject(memDC, oldPen);
        SelectObject(memDC, oldBrush);
        DeleteObject(hBlackPen);
        DeleteObject(hBlueBrush);
        SelectObject(memDC, oldBM);
        DeleteObject(memBM);
        DeleteDC(memDC);
        EndPaint(hWnd, &ps);
        break;
    }

    case WM_ERASEBKGND:
        return 1; 

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {

    PrecomputeRotationsAndScales();

    WNDCLASS wc = {0};
    wc.lpfnWndProc = WndProc;
    wc.hInstance = hInstance;
    wc.lpszClassName = "TetrahedronClass";
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    RegisterClass(&wc);

    HWND hWnd = CreateWindow("TetrahedronClass", "3D Tetrahedron precalculated", WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 512, 512, NULL, NULL, hInstance, NULL);

    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    if (precomputedProjections) {
        for (int xStep = 0; xStep < rotationSteps; xStep++) {
            for (int yStep = 0; yStep < rotationSteps; yStep++) {
                delete[] precomputedProjections[xStep][yStep];
            }
            delete[] precomputedProjections[xStep];
        }
        delete[] precomputedProjections;
    }
    if (precomputedFaces) {
        for (int xStep = 0; xStep < rotationSteps; xStep++) {
            delete[] precomputedFaces[xStep];
        }
        delete[] precomputedFaces;
    }

    return msg.wParam;
}
Image
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
CuteAlien
Admin
Posts: 9840
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by CuteAlien »

Be very careful with using sleep on Windows. I did fall into that trap before assuming the ms you pass are somewhat exact. Turns out - it's around 15ms minimum - so as soon as you use a single sleep you'll end up limited to around 65 fps (and lots of monitors have a higher frequency these days). I guess that's also where your 66fps limit comes from. With svn trunk you can maybe use yield() in combination with a time-check (haven't really tried yet). Or no yield and just burn the CPU ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

CuteAlien wrote: Tue Jan 28, 2025 4:14 pm Be very careful with using sleep on Windows. I did fall into that trap before assuming the ms you pass are somewhat exact. Turns out - it's around 15ms minimum - so as soon as you use a single sleep you'll end up limited to around 65 fps (and lots of monitors have a higher frequency these days). I guess that's also where your 66fps limit comes from. With svn trunk you can maybe use yield() in combination with a time-check (haven't really tried yet). Or no yield and just burn the CPU ;-)
Image
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

Noiecity wrote: Tue Jan 28, 2025 11:35 am I could help you, but I need you to tell me what your app will do.

I would like to learn shaders someday to help cutealien with that at least, I feel useless.
I'd say look at the software functions in Irrlicht just to familiarise with what IrrSoft can do. Perhaps there is a putPixel() getColor() in there. How else would software work? The book said as long as you can open a window and receive input, take time to test functions and it'll work eventually.

The Bill -> Date -> Calendar problem is making me think a lot, and it's taken more than the 3 weeks to make the Date code.
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Wed Jan 29, 2025 9:40 am
Noiecity wrote: Tue Jan 28, 2025 11:35 am I could help you, but I need you to tell me what your app will do.

I would like to learn shaders someday to help cutealien with that at least, I feel useless.
I'd say look at the software functions in Irrlicht just to familiarise with what IrrSoft can do. Perhaps there is a putPixel() getColor() in there. How else would software work? The book said as long as you can open a window and receive input, take time to test functions and it'll work eventually.

The Bill -> Date -> Calendar problem is making me think a lot, and it's taken more than the 3 weeks to make the Date code.
You will probably have to save the invoice in a binary file and work from there by reading it. I have an example but it is using windows.h. It is practically creating a database. The other thing is to use sqlite for your project, in devc++ you can install sqlite from a devpack.
I think you can also just use iostream to write such a binary file, I haven't studied iostream enough yet so I don't know.
Mainly you have to do the following:
Check if the binary file exists, if it exists, check if you have data or if it is empty, in case it is with data check that it matches your data structure, if it does not match, replace with an empty file. Once this is done, you have to be able to enter values of data structures inside the binary file, and read it, use the .bin format, I recommend you. You must use one or more non-repeatable ids to differentiate the data from each other, the same to be able to modify, take as reference those ids. You need more than one ID if you are separating data structures that are related by one of the IDs, for example, separating item id, with character id in an rpg. Each data structure must have its own non-repeatable id. So for example, character can have several instances of item id, but only one of character id, while in the item structure, there can only be one non-repeatable item id, etc.
The same thing happens when you make an rpg and want to save a game. To delete you must also use that id.
Once you have this you can have a database that is updated with new data, easy to maintain, easy to update.
Now, you must write functions to verify that the data entered by the user matches the expected data, if not, do not take the data and warn the user that an error has occurred. In an RPG you must first block the ability to be able to write, for example, characters or symbols where there should only be unsigned integers, etc.
The data must also be verified in case the memory is corrupted in the process due to a semiconductor failure and modifies the expected data.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

If

Code: Select all

int i = 0;
Is i stored in the .exe or in ram?
How would an int be held in the exe then explicitly told to enter ram?
When the exe runs, is it then placed into ram?
For me at the moment, and I checked a couple of videos, everything is automatic. A .cpp file, a .o file and a .exe file lives on the disk drive.
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Thu Jan 30, 2025 11:01 am If

Code: Select all

int i = 0;
Is i stored in the .exe or in ram?
How would an int be held in the exe then explicitly told to enter ram?
When the exe runs, is it then placed into ram?
For me at the moment, and I checked a couple of videos, everything is automatic. A .cpp file, a .o file and a .exe file lives on the disk drive.
The executable is the compiled file, whatever you save as in int is saved in memory or stack, if you close the application any data that was in ram will be cleared and will not prevail in it if it has not been programmed to be saved to disk. SQLite allows you to save such data as if it were a database locally in a .db file that can be read by the same program. Or you can create a .bin file yourself that meets these requirements.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

I'm too lazy and impatient. I struggled to think how the program "holds back" any data, unless texture streaming (is a word) loads data off the hard drive as and when needed...? Why can't the binary get large and hold it in the same way?

I'm sure there are very complicated answers I won't / we won't get to yet, but I am still attempting software status! I found a really nice free modeller for Linux and saves as a MilkShape3d file. getMesh loads it in. I have draw rectangle running with my grid system and can draw lines (if a little slowly). The only way I knew how to draw the box before the 2D stuff was call render() manually.

Another idea was to build a map somehow (this is all 3D) on software and try to remove the missing walls by designing the map in a certain way (very small tunnels).

It's a start anyway and I'll investigate Irrlicht some more. The more software stuff I know is good learning :cross_fingers:
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

That's why I said you have to use an ID to know the data structure above, so you can have several data encapsulated by a unique non-repeatable ID, I have some examples, but it involves using windows.h and c++98, I don't have examples using iostream, besides they are inside a code that is in charge of saving invoices in a .bin file of an inventory.
I also have an example of a program that converts png images into a .bin file (only extracts the coordinates, ignores the coordinates with transparency, and the semitransparent ones turn them into rgb without transparency) that can be read in another program that produces a double buffer of the same, that scales according to the resolution, mmm....

I have problems with using directx9 and opengl, and is that, by default they come with an API that consumes too many resources of the graphics card without being able to modify these values, and if you try to build an application that accesses the memory of the video card the kernel of the operating system blocks you... the graphic interface of the operating system has a low load with respect to the graphic card, so I end up preferring to use GDI... which offers more stability, although less FPS(only because by default it consumes less resources, indirectly it has less performance, but more stability lmao)
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

Keep them a secret ;) Until one is trustworthy enough ;)

I'll show something when I can.

The modeller is called Maverick Model 3D. He picked up the work from another developer and worked on it for over 10 years. He's now working on a closed source engine that he'll most likely sell at some point.

When I first used it I was happy that he gave it away for free. Free software is great, especially if it's awesome, but at some point he may want some money for the hard work.
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

A cpp file will compile down to an exe - that's the magic compiler bit
When the exe is loaded, the OS chooses what goes into ram and when - that's the bit I'm trying to suss out
If a bin file(!) is made, it can be read by a C++ stream program - this way pre calculated numbers can be read at run time

So I guess what the Quake tools did - run bsp, vis and rad on a map file beforehand to get the numbers required by the drawing engine?

edit:
There are other ways... I saw the Boost library can play with ram and mmap in C++ - but a little over my head.
I myself would start with files. "Yes Kevin, that's a good idea."
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Sun Feb 02, 2025 4:08 pm A cpp file will compile down to an exe - that's the magic compiler bit
When the exe is loaded, the OS chooses what goes into ram and when - that's the bit I'm trying to suss out
If a bin file(!) is made, it can be read by a C++ stream program - this way pre calculated numbers can be read at run time

So I guess what the Quake tools did - run bsp, vis and rad on a map file beforehand to get the numbers required by the drawing engine?

edit:
There are other ways... I saw the Boost library can play with ram and mmap in C++ - but a little over my head.
I myself would start with files. "Yes Kevin, that's a good idea."
Thank you for continuing to respond. Yes, the precomputed graphics can be saved in the .bin file, so you save having to precompute every time the program is opened, which would lead to a heavier application somewhere on the disk or ssd, and a bit more load for the ram memory in some cases(less than the load that would give you several 8k textures and millions of polygons trying to load in each real time calculation).

The problem arises that there is not much documentation regarding this, but many PS2 games used similar methods to this, like the first god of war(running shadow volume(or like this) with multiples entities, lights, particles effects, and so on, with 32 mb of ram, 4 mb of vram, and 0.29 ghz of cpu, and 0.147 very good ghz of gpu)
Image
But the logic is the same, store the values of the results of the memory calculations in a binary file so you only have to load it into the ram and read them. You can even pre-calculate the calculation you do to read, so that you just enter the values directly into the memory (double buffer).

It is quite practical but requires a lot of thinking...

I remember that reading a .bin file can take less than 1 ms so.... I think the experts in precalculation are the the developers who created databases like mariaDB or postgreSQL, etc.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

I havent tested the speed, and only used a really small txt file... (I am using c++11/17 for this)

Code: Select all

#include <iostream>
#include <fstream>

int main()
{
	std::string file {"greetings.txt"};
	std::ifstream istr {file};
	std::string temp;
	while(istr >> temp)
	{
		std::cout << temp << "\n";
	}
	
	return 0;
}
I used GHex to view the binary stuff, and I knew the "greetings.txt" gets stored, but what I didn't see in the hex values - no data from the text file. My idea was to press a key while Irrlicht is running, run the function that stores the pre calc stuff, then act on it.

Particle effects, light falloff values on textures, positions of vectors... I'm gonna write a program that moves a guy model in a circle. The sin/cos values have already been made, just need Irrlicht to read them.
Noiecity
Posts: 252
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Mon Feb 03, 2025 9:41 am I havent tested the speed, and only used a really small txt file... (I am using c++11/17 for this)

Code: Select all

#include <iostream>
#include <fstream>

int main()
{
	std::string file {"greetings.txt"};
	std::ifstream istr {file};
	std::string temp;
	while(istr >> temp)
	{
		std::cout << temp << "\n";
	}
	
	return 0;
}
I used GHex to view the binary stuff, and I knew the "greetings.txt" gets stored, but what I didn't see in the hex values - no data from the text file. My idea was to press a key while Irrlicht is running, run the function that stores the pre calc stuff, then act on it.

Particle effects, light falloff values on textures, positions of vectors... I'm gonna write a program that moves a guy model in a circle. The sin/cos values have already been made, just need Irrlicht to read them.
don't use .txt, use .bin, .txt are hard to read, c++ practically reads .bin like drinking water
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 180
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

I never heard of bin files before.

Image
https://github.com/brainchemicals/TryPreCalc
All it does it grab x,y values from sine and cosine and puts them in a text file, then loads the x,y pairs when you press "RUN".

The files are prec.cpp and man.cpp. The models are a bit of fun. The preceded.txt it comes with is better to see the model moving, so just run man and it finds the data.

The waste string was to see if the hex editor could find any reference to the file I was about to use/open. There were no "floatxy" entries in the hex file. Yes I made a mistake and my man was flying around on the y-axis :) I don't think it'll run on C98 because of the fstream... But it's a start!
Post Reply