Coder Social home page Coder Social logo

Store multisampling in FBO about raylib HOT 3 CLOSED

victorfisac avatar victorfisac commented on May 8, 2024
Store multisampling in FBO

from raylib.

Comments (3)

raysan5 avatar raysan5 commented on May 8, 2024

Hello @victorfisac ,

SetConfigFlags(FLAG_MSAA_4X_HINT) tryes to setup multisampling on main framebuffer, it depends on OpenGL version (> 3.0) and hardware support (ARB_multisample extension). Setting multisampling on FBO requires manual setup; the default FBO used for post-processing effects has no multisampling enabled, it will consume too much resources, specially for embeded and low-end devices.

If you desire to implement an antialiasing algorythm to your post-produced image, my recomendation is using FXAA antialiasing. It can be directly implemented on the fragment shader and it's very fast. You can find more information here:

http://www.kotaku.com.au/2011/12/what-is-fxaa/
http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/

from raylib.

victorfisac avatar victorfisac commented on May 8, 2024

Found a working FXAA fragment shader! Here is an adapted to raylib version: http://pastebin.com/ZE6w1LKi

Changed to version 330 and var names to fragTexCoord and fragColor. The shader just needs the screen resolution to work.

Source: https://www.opengl.org/discussion_boards/showthread.php/184192-GLSL-FXAA-rendering-off-screen

I think maybe it can be optimized a little bit... not sure. Tested with shaders_custom_uniform.c and dwarf model, nice result! :D I could test FPS drop, I disable SetTargetFPS() and it is still limited to 60 (also disabled Vsync in nvidia panel)...

from raylib.

raysan5 avatar raysan5 commented on May 8, 2024

Thanks @victorfisac!

FXAA fragment shader and an example will be added to raylib shaders collection on next version!

from raylib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.