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.


Topics - tomvidm

Pages: [1]
1
Graphics / A question about VertexBuffer::update
« on: October 07, 2018, 08:56:36 pm »
I'm not into OpenGL coding, so I'm not able to find the answer on my own.

I'm using the VertexBuffer class for a Tilemap system, as I understand that VertexBuffer allows me to make changes to selected vertices, as opposed to VertexArray which copies all the vertices for each draw call.

My question is:
Is the update method an expensive method? If I update one vertex and the draw, I understand that this is much better than updating one vertex in a VertexArray and making a draw call.
But what if I update N vertices of a VertexBuffer, K times? What does the update method really do?

2
SFML projects / (SSML) Simple & Slow Multimedia Library
« on: October 05, 2018, 12:44:09 pm »
    (SSML) Simple & Slow Multimedia Library

    I have been working on a hobby project, with the aim of using it for developing simple games using SFML. Currently, it is a collection of unfinished features and some working features. There is nothing that this library can do, that other solutions don't do better, but for me it has been an incredible learning experience so far.

    https://gitlab.com/tomvidm/ssml

    If you feel interested, I believe the README.md explains how to compile. Tested using VS17 on windows and gcc on Ubuntu. Compilation requires CMAKE.

    Documentation:
    https://tomvidm.gitlab.io/ssml/

    Currently, the project includes a showcase of the CompositeTilemap. I am continually updating the project and adding features and fixes.


    The image showcases the CompositeTilemap class, but with colors instead of texture rects. The red rectangle shos the visibility bounds, and all tilemaps whose bounds intersect with it, will be visible. The subtilemaps are stored in a hash map, so "holes" are allowed.

    SSML classes and functions are in the namespace ss::graphics, ss::system, ss::math and so on. Some SFML objects are aliased to look like part of SSML , because I want the public interface to be as clean as possible.

    I would love to hear suggestions for improvements. And I do not shy away from criticism. This has been worked on as a personal project without input, and it is only healthy to have someone point out the smelly stuff.

    Below is a non-exhaustive list of features and planned features. A more ambitious list of planned features is found in the README.md in the git repository. The GitLab reposity also has a list of issues detailing some of the design process and things I need (or just want) to do.

    Graphics
    Current features:
    • Custom sprites with built in sprite animation system.
    • Tileset, allowing the user to add texture rects to a vector, with additional string mapping for comfortable use of spritesheets. Possibility to load tilesets using JSON with a specific format. Undocumented! Yay!
    • Tilemaps which maps indices to the corresponding texture rects in a Tileset, with no member methods to do so yet!
    • Composite Tilemap, to let the user compose a world from individual tilemaps. Only renders the visible submaps.
    • An abstract class Renderable which inherits from both sf::Drawable and sf::Transformable, with added methods for obtaining local and global bounds. Good for visibility checks.
    • Simple renderer. Simply attach a sf::drawable or a ss::Renderable to the renderer and tell it to renderAll().
    • A TextureManager to keep your rectangles non-white, textures safe and accessible through a string alias

    Planned features:
    • Implement ordered rendering layers, allowing easy switching of what is rendered. For example for pause menus or other things.
    • Automatic resolution of draw order per render layer
    • Built in GUI and
    • Support isometric tilemaps! Ok, they are just transformed rectangular tilemaps, but the SFML transform class does not provide methods for isometric transforms.

    Math module
    Current features:
    • Convenient functions for dealing with vectors and computational geometry.
    • Linear and bilinear interpolation (Lerp and blerp!).
    • Heightmap. A 2d array of values that can be operated upon. Slow and badly named.

    Planned features:
    • Bezier curves and B-splines for drawing curves and interpolation
    • Simple graphs with implementations of the usual algorithms
    • Whatever is needed to do what I want.

    Event system
    Current features:
    • Translating SFML input events into SSML input events. SSML input events have sligthtly more detail that SFML events and makes it easy to check for hold time, last position of a press or release and to check the distance dragged while holding a button.

    Planned features:
    • To allow the user to define keystrokes and allow other objects to listen for these events.
    • To allow the user to optionally track button mashing or mouse shaking.
    [/list]

    3
    Graphics / A question about Transforms sent in a states structuer
    « on: July 17, 2018, 01:59:02 pm »
    As I understand, when calling draw with a transform in the RenderStates structure, the transform is applied on the GPU. Is this true?

    I want to benchmark the point where large number of draw calls breaks even with a large number of transforms applied on individual vertices of a VertexBuffer with a single draw call. Knowing where the transform is performed will help me understand what is going on.

    Pages: [1]
    anything