DK Game Companies | DK Game Productions | Translate | Contact | Latest threads |

| Main forum | Site Content | Jobs | Showcase | Offtopic | Calender |
| Themes: Mobile | Dark1 | Dark2 | (Login required for themes) |

Username:   Password:   Log me on automatically each visit  


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
Unread postPosted: 13 Mar 2018, 10:03 
Offline
Level 0 - Null
User avatar

Joined: 13 Mar 2018, 09:44
Posts: 1
Location: Fyn
Jeg er i gang med at optimere spritebatcheren til mit open source spiludviklings bibliotek, libpp. https://github.com/PolyplexEngine/libpp

Hvad er den mest optimale måde at lave sprite batching på til det?, jeg vil stadig beholde den basiske shader layout som jeg har nuværende.
Kan det være et stort problem at jeg har garbage collection til? (kan bruge @nogc til at slå garbage collector fra for klasser og funktioner)

Vertex Shader:
Code:
#version 130
in vec3 ppPosition;
in vec2 ppTexcoord;
in vec4 ppColor;

uniform mat4 ppProjection;

out vec4 exColor;
out vec2 exTexcoord;

void main(void) {
   gl_Position = ppProjection * vec4(ppPosition.xy, 0.0, 1.0);
   exTexcoord = ppTexcoord;
   exColor = ppColor;
}


Fragment Shader:
Code:
#version 130

precision highp float;

uniform sampler2D ppTexture;
in vec4 exColor;
in vec2 exTexcoord;
out vec4 outColor;

void main(void) {
   vec4 tex_col = texture2D(ppTexture, exTexcoord);
   outColor = exColor * tex_col;
}



Nuværende fylder jeg et VBO buffer op hver frame, med Vertex positioner, RGBA farver (som floats) og UV koordinater. Men ville instancing af vertex positioner hjælpe overhoved, vil et IBO buffer også hjælpe? Er ikke sikker, lidt ny til OpenGL.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group