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 - underdisk

Pages: [1]
1
Graphics / Re: Drawing a short line between Sprite & Mouse
« on: June 11, 2018, 06:48:29 pm »
You could compute the vector (the actual arrow, direction vector) and then normalize it (meaning chaning it's size to 1, you can easily check how to do that by checking the internet.

Then you can multiply this vector by a constant to get a fixed length (and then return from your vector to your line with math magic)

2
Graphics / Re: Chunk rendering
« on: June 10, 2018, 11:12:26 pm »
Ahhh I see, baking a texture atlas...

Wouldn't that be problematic for a large number of blocks ? (max texture resolution etc)

3
Graphics / Re: Chunk rendering
« on: June 10, 2018, 10:15:24 pm »
It's possible to put multiple textures in one VB ?

4
Graphics / Chunk rendering
« on: June 10, 2018, 09:26:48 pm »
Hello people. First I would like to apologize if this is the wrong place to post this (as it's very 'specific')

So.

I'm trying to do an isometric (yes I know it's not the correct term) style engine-thing and i'm also experimenting with the new sf::VertexBuffer class.

I made a simple Cube class, that is able to display a cube or a floor from an input texture.

For example, this is a 'skin' texture :


And here are the results using the CUBE and FLOOR mode :



As you can see this works well. The problem is that I would want them to be able to stack up (to make a full world out of them). For now, the program is using 1 draw call per cube, wich is a lot to consider if I want to make a world.

It would be cool to make a 'Chunk' system, with 1 draw call per chunk. Except I don't know how to do that considering that a chunk can be made of multiple cubes using multiple textures.

So how can a system like this be implemented ? (Ask me if you want me to put some code examples)
Thank you in advance.

Pages: [1]
anything