Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Mortal

Pages: [1] 2 3 ... 17
SFML projects / Re: Screenshot Thread
« on: December 08, 2019, 10:27:29 am »
hello everybody  :)

working on my latest hobby OpenGL framework. I have implemented simple Ray class to complete the set of collision detected geometries.

I made simple mouse picking demo based on what I have already implemented so far.


SFML projects / Re: Screenshot Thread
« on: November 25, 2019, 11:37:46 pm »
hello guys.  :)

i made a simple prototype 3D Space Invaders to test my latest collision detection implementation in real time with actual game or kind of. it seems work fine until now. also, i added basic animation to 3D models.

here demo:

SFML projects / Re: Screenshot Thread
« on: November 01, 2019, 05:56:21 pm »
hi guys  :)
i made a demo to test AABB & OBB Collision Detection With Frustum Culling.
  • SFML for the window & keyboard-mouse inputs
  • assimp Library for loading the 3D objects
  • rendering by using a modern OpenGL 4.4 (VA/VBO/IBO/FBO-for matrices to upload it to
      its shader program) with glDrawElements/GL_TRIANGLES. all the
      debug shapes (frustum-AABB-OBB) were drawn by using
      (VA/VBO/IBO) with glDrawElements/GL_LINE_STRIP too
  • glm  library for the matrices and vectors.
  • jpeg/FreeImage library for loading the textures.
  • imgui for the GUI



  • i have implemented an octree data structure, and now i'm able to subdivide a game world into smaller and smaller sections for optimizing the collision detection.
  • i added a sphere bounding shape.
  • i have implemented third person or orbit camera, it helps a lot to view the game world.
  • now, all the debug shapes [AABB,OBB,Sphere,Frustum,Octree] were drawn by instances which is used a buffer object [GL_ARRAY_BUFFER] and the drawing command is done by calling glDrawElementsInstanced/GL_LINE_STRIP

here demo for latest update:

General / Re: Help with basic fragment-shadered full-screen sprite
« on: February 12, 2019, 06:25:58 pm »

no need to use sprite and texture to draw fragment shader. just use sf::RectangleShape to get fullscreen to draw on it. also, no need to provide the vertex shader. like so:

#include <SFML/Graphics.hpp>

#define GLSL120(src) "#version 120 core\n" #src

static const char* frag = GLSL120(

uniform float time;
uniform vec2 resolution;

float h(float i) {
        return fract(pow(3., sqrt(i / 2.)));

void main(void) {

        vec2 p = gl_FragCoord.xy*2. - resolution;

        float a = floor(degrees(4. + atan(p.y, p.x))*2.) / 4.;

        float d = pow(2., -10.*fract(0.1*time*(h(a + .5)*-.1 - .1) - h(a)*1000.));

        if (abs(length(p) - d*length(resolution)) < d*35.) {
                gl_FragColor = vec4(d*(h(a + .5)*3.));
        else {
                gl_FragColor = vec4(0.);


int main()
        sf::RenderWindow window({ 800, 600 }, "SFML Shader Example");

        sf::RectangleShape fullscreen({ 800, 600 });
        sf::Shader shader;
        if (!shader.loadFromMemory(frag, sf::Shader::Fragment))
                return -1;

        shader.setUniform("resolution", sf::Vector2f({ 800, 600 }));

        sf::Clock clock;
        while (window.isOpen()) {
                sf::Event event;
                while (window.pollEvent(event)) {
                        if (event.type == sf::Event::Closed)

                shader.setUniform("time", clock.getElapsedTime().asSeconds());

                window.draw(fullscreen, &shader);

Graphics / Re: Problem with drawing from a vector.
« on: January 29, 2019, 02:18:04 pm »
sfml does't copy the transform if you want sorting them, so you have to swap the positions too like so:
if (rods.at(j).getSize().y > rods.at(j + 1).getSize().y)
        swap(rods[j], rods[j + 1]);
        auto p1 = rods[j].getPosition();
        auto p2 = rods[j + 1].getPosition();
        rods[j + 1].setPosition(p1);
        swapped = true;

General / Re: Pause
« on: December 27, 2017, 01:20:08 pm »
to make a pause for your game you need to skip the update section in your game loop

here a pseudo code:

while (mWindow.isOpen())
        if (!pause) {

SFML projects / Re: Tic Tac Toe
« on: December 27, 2017, 12:55:48 pm »
i'm back to my first GUI game that i made few years ago. i implement minimax algorithm to improve AI now the game become unbeatable  :P

source code: https://gist.github.com/MORTAL2000/c8014042a65985a568b5dd7c2f635cab

SFML projects / Re: Screenshot Thread
« on: June 07, 2017, 08:27:59 pm »
inspired from Hapax works .. i made a matrix rains in 3D  ;D ;D


SFML projects / Re: Tower Defence
« on: May 15, 2017, 05:43:12 am »
thanks for compliment. but i'm still a beginner in both C++/OpenGL. all i have done is adding sfml extend (window creation and input handling) to that engine.

i would recommend SFML Game Development book. if you were interesting to learn how to make 2D/3D game engine from scratch.

SFML projects / Re: Tower Defence
« on: May 13, 2017, 11:05:09 am »
thanks roccio  :)

SFML projects / Re: Tower Defence
« on: May 13, 2017, 08:07:00 am »
fixed minor bug within sfml input. event mouse position gives sometime wrong values.

i've included exe file.here link if someone wants to try it.

SFML projects / Tower Defence
« on: May 11, 2017, 08:59:27 pm »
i was planning to begin with 3D game as my first 3D project, but i have found an old game called Starports when i was looking for assets to make simple tower defence. but unfortunately it doesn't support SFML.

i wrote SFML extension to that engine. since it does exactly what i want to achieve for now.

here game-play video:

EXE file

SFML projects / Re: Screenshot Thread
« on: May 06, 2017, 12:19:01 pm »
thanks eXpl0it3r  :)

my plan to create simple 3D game like space-shooter or perhaps tower defense. haven't decided yet.
all i had done so far are implemented 3D render engine and basic collusion detection as first step to to go with 3D physics.

SFML projects / Re: Screenshot Thread
« on: May 06, 2017, 11:25:58 am »
finally, i implemented oriented bounding box (OBB) correctly.

here test

SFML projects / Re: "Our Dear Paper Fighters" - Top down shooter
« on: April 17, 2017, 08:10:49 pm »
awesome, i really like your work.

Pages: [1] 2 3 ... 17