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

Author Topic: SFML 3 - What is your vision?  (Read 236132 times)

0 Members and 1 Guest are viewing this topic.

therocode

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Development blog
Re: SFML 3 - What is your vision?
« Reply #45 on: April 28, 2014, 10:13:10 am »
Support texture packer.

The other week I tried using texture packer but it is not a free product. You have to pay to use it and the trial version makes some sprites red with the text "trial version" on them. IMO SFML which is a free library should not integrate with non-free products.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: SFML 3 - What is your vision?
« Reply #46 on: April 28, 2014, 11:36:23 am »
I think SpriteBatch would be great addition for SFML 3 and it is even not that hard to do.
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML 3 - What is your vision?
« Reply #47 on: April 28, 2014, 11:49:33 am »
It's nice seeing all this feedback, rest assure we'll be discussing most of the points and some have already been kind of agreed on before this thread started. ;)

As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or what's the difference between batching and non-batching?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: SFML 3 - What is your vision?
« Reply #48 on: April 28, 2014, 04:13:13 pm »
It's nice seeing all this feedback, rest assure we'll be discussing most of the points and some have already been kind of agreed on before this thread started. ;)

As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or what's the difference between batching and non-batching?
You can sort them, pass same values easily to large group of sprites (for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch), pass blending to large group of sprites easily and so. Imo, sprite batch is better for bigger projects, and for small ones, it is better to use normal rendering (becouse it is pointless to create new spritebatch f.e. for 2 sprites). Look for example at my implementation of SpriteBatch to my engine. It is working exactly like drawing sprites to RenderWindow, you can pass there IDrawable (for example Sprite) and spritebatch will enqueue it. It is highly modified version of krzat´s spritebatch https://bitbucket.org/krzat/sfml.utils/src/ce2ec1656e13424141b23583b495197b60bd2fcf/SpriteBatch.cs?at=master

P.S Sorry for my english ;)
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: SFML 3 - What is your vision?
« Reply #49 on: April 28, 2014, 04:26:20 pm »
Isn't that mixing two different concepts? What has been discussed here before was sprite batching as in making something like a vertex array more automated/accessible. While what you describe sounds more like a node system. Is that the same?

(for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch)
Sounds like you didn't understand how to use views properly. You can use multiple views to render things independently without "corrupting drawing", unless you meant something else.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: SFML 3 - What is your vision?
« Reply #50 on: April 28, 2014, 04:44:40 pm »
Isn't that mixing two different concepts? What has been discussed here before was sprite batching as in making something like a vertex array more automated/accessible. While what you describe sounds more like a node system. Is that the same?

(for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch)
Sounds like you didn't understand how to use views properly. You can use multiple views to render things independently without "corrupting drawing", unless you meant something else.

I think it isn´t mixing different concepts. You can imagine SpriteBatch like another drawable (your example with VertexArray is perfect). Some pseudo-codes
You can use (for single sprite)
Code: [Select]
RenderWindow.Draw(Sprite);
For multiple sprites:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

And for sorting and other fancy stuff you can overhaul Begin (or End, idk where it belong better, for demonstration, let´s say begin)
Code: [Select]
SpriteBatch.Begin(Sort.Inverse, TransformMatrix, Blending.Add)

And for views, I mean using for example
Code: [Select]
RenderWindow.SetView()
For scaling, zooming, moving entire screen. And I do not want to create new render textures just for using 2 different views. Correct me if I do not got views functionality correctly.
« Last Edit: April 28, 2014, 04:48:06 pm by Deathbeam »
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Haze

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Github Profile
Re: SFML 3 - What is your vision?
« Reply #51 on: April 28, 2014, 04:48:17 pm »
One feature I would love to see added in the Graphics module is rendering masks, especially texture-based masks.
There's already a task in the tracker: issue #1 - Implement rendering masks
I understand this is something quite big but it's been 3 years already, and some user has already proposed a working implementation. Please see this post, you can see in the screenshots what kind of neat tricks you can achieve with this feature.


Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: SFML 3 - What is your vision?
« Reply #52 on: April 28, 2014, 04:51:04 pm »
As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or dwhat's the difference between batching and non-batching?


A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.
« Last Edit: April 28, 2014, 04:54:08 pm by Jebbs »
DSFML - SFML for the D Programming Language.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: SFML 3 - What is your vision?
« Reply #53 on: April 28, 2014, 04:55:21 pm »
A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it. Example directly copied from SpriteBatch in my engine:
Code: [Select]
                ////////////////////////////////////////////////////////////
/// <summary>
/// Draws all queued sprites for this vertex batch. Call
/// this only after calling End().
/// </summary>
////////////////////////////////////////////////////////////
public void Draw(SFML.Graphics.RenderTarget target, SFML.Graphics.RenderStates states)
{
uint index = 0;
foreach (var item in _textures)
{
states.Texture = item.Texture;

target.Draw(_vertices, index, item.Count, SFML.Graphics.PrimitiveType.Quads, states);
index += item.Count;
}
}
« Last Edit: April 28, 2014, 04:57:07 pm by Deathbeam »
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: SFML 3 - What is your vision?
« Reply #54 on: April 28, 2014, 05:06:20 pm »
A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it.

Perhaps I oversimplified it by mentioning only one texture, but yeah, sprite batches should work regardless of the thing being drawn has the same texture as anything else in the batch. That was just supposed to be a basic example to explain the underlying concept to eXpl0it3r. ;)
« Last Edit: April 28, 2014, 05:09:09 pm by Jebbs »
DSFML - SFML for the D Programming Language.

Carlitox

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: SFML 3 - What is your vision?
« Reply #55 on: April 28, 2014, 05:45:29 pm »
- Change the developement direction to a game programming framework not being only a media layer.
- Integrate thor library
- Create an entity system
- Create a TiledMap class
- Messaging systems
- Lua scripting class that exposes entities, camera and the map
- Scripted quest system


One way to do it it's create another layer.
« Last Edit: April 28, 2014, 05:55:06 pm by Carlitox »

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: SFML 3 - What is your vision?
« Reply #56 on: April 28, 2014, 05:52:08 pm »
- Scripted quest system

I think this is way too specific for a library. I can think of many games (let alone applications) that would never, ever need this. A lot of game engines (which SFML is not) don't even go to these sorts of lengths.
Follow me on Twitter, why don'tcha? @select_this

Carlitox

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: SFML 3 - What is your vision?
« Reply #57 on: April 28, 2014, 06:02:07 pm »
- Scripted quest system

I think this is way too specific for a library. I can think of many games (let alone applications) that would never, ever need this. A lot of game engines (which SFML is not) don't even go to these sorts of lengths.


Yes it is.

Abstract that could be difficult but challenging,

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: SFML 3 - What is your vision?
« Reply #58 on: April 28, 2014, 06:16:41 pm »
Don't forget that SFML by the first is SIMPLE. And library. Not an engine. SFML does not need any engine features, but crossplatform interfaces. I think that current of I/O routines are necessarily need to improve and extend.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: SFML 3 - What is your vision?
« Reply #59 on: April 28, 2014, 07:07:51 pm »
- Change the developement direction to a game programming framework not being only a media layer.
- Integrate thor library
- Create an entity system
- Create a TiledMap class
- Messaging systems
- Lua scripting class that exposes entities, camera and the map
- Scripted quest system


One way to do it it's create another layer.

You must remember that SFML is multimedia library, NOT game engine :D Most of things what you listed are not even essential for game framework, you cannot think that with SFML you will have "pre-made" game ;)

A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it.

Perhaps I oversimplified it by mentioning only one texture, but yeah, sprite batches should work regardless of the thing being drawn has the same texture as anything else in the batch. That was just supposed to be a basic example to explain the underlying concept to eXpl0it3r. ;)
Yep, you oversimplified it :D
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...