shaptic / zenderer Goto Github PK
View Code? Open in Web Editor NEWMy 2D OpenGL Rendering Engine -- Revamped
License: Other
My 2D OpenGL Rendering Engine -- Revamped
License: Other
Support for basic Lua scripting.
Draft and implement a management system for OpenGL shader programs. With all of the local gfx::CEffect
instances, there is a lot of duplicate programs linking together the same shader objects.
Create a more complete zen::math::matrix4x4_t
class that supports translation, rotation, and scaling via vectors and other matrices.
With commit df62bf0 and the closing of Issue #17 came a new problem that doesn't allow for anything but the model-view and projection matrices to be changed within a shader / effect.
The easiest and likely best fix would be to separate setting custom matrices and setting the standard ones.
zEffect::SetProjectionMatrix(const math::matrix4x4_t& proj) const;
zEffect::SetModelViewMatrix(const math::matrix4x4_t& mv) const;
zEffect::SetParameter(const string_t& name, math::matrix4x4_t& matrix);
Note which are const
and which aren't.
Currently, the font API uses individual quads for every character, and thus causes a performance hit with the excessive state changes when rendering to a obj::CEntity
instance.
The suggested model would use a texture atlas internally, thus speeding up rendering performance significantly. All changes should happen behind the scenes, so any documentation should properly transfer to the new functionality and the user should not see any changes in the way they use the API.
Implement a sort of "uniform lookup table" in order to minimize queries to OpenGL via glGetUniformLocation()
.
Something like this would be ideal:
GLuint gfxcore::zShaderSet::GetUniformLocation(const string_t& name)
{
if (m_cache.find(name) == m_cache.end())
{
GLint loc = glGetUniformLocation(m_program, name.c_str());
if (loc == -1) // bad uniform
return -1;
m_cache[name] = loc;
}
return m_cache[name];
}
void*
when really string_t
)CRenderTarget
instead of copyAdding buttons to menus renders the wrong text for all buttons past the first one.
The current version of the material API is a convoluted interface with complex access to internal members and their respective functionality (CEffect
and CTexture
). There is too much pointer interaction and possibility for segmentation faults via nullptr
access.
Possible ideas for improvement include:
ZEN_FATAL
errors when accessing a nullptr
memberThere are also issues with access to the CAssetManager
necessary for loading the shaders and the CTexture
instance internally.
There are a lot of issues passing around CAssetManager&
instances right now, largely due to the fact that there are no high-level interfaces completed yet (I'm looking at you, CScene
). Possible workarounds include:
CAssetManager
instance, that can be accessed similarly to CLog::GetEngineLog()
CAssetManager&
in the constructor of any object that needs it, or via an AttachAssetManager(CAssetManager&)
method if the object is an asset itself, or if it's optional, like in gfx::CWindow
(thus storing a pointer since references must be initialized immediately). If there is nothing attached and some operation is done, a ZEN_FATAL
error should be thrown, or something along those lines.The current test-bed program crashes after exiting. In a debug build (ZEN_DEBUG_BUILD
enabled), the relevant assertion is as follows:
glDeleteProgram(m_program) failed at line 284 of zenderer\src\coregraphics\shaderset.cpp: 1282 (invalid operation).
In a non-debugging build, on Windows, the program gives a runtime error indicating a "pure virtual function call," followed by an APPCRASH in MSVCR110.dll.
This crash only occurs if the user clicks the 'X' button to exit. If they choose the "Quit" menu option, there is no crash. It's unknown whether this is only for this specific program, or for all cases, thus the necessary to investigate the cause.
I believe that the bug is caused by a flaw in the engine resource management architecture. When a window is deleted, all OpenGL assets are invalidated. Later, when zen::Quit()
is called, the routine will attempt to free all registered OpenGL subsystems (gfxcore::zGLSubsystem
), and object destructors are called. This, in turn, will call gfxcore::zShaderSet::~zShaderSet()
, which then attempts glDeleteProgram()
on an invalid OpenGL program handle.
Re-design obj::zEntity
to accommodate a variety of primitives (not limited to gfx::zQuad
). This includes using gfx::zPolygon
and collision detection via triangulation.
Potential ideas:
gfxcore::zDrawable
base class as gfx::zPolygon
is, and have child classes such as gfx::zQuad
just be 4-vertex specializations of the polygon.gfxcore::zDrawable
object to be given to obj::zEntity
and somehow appropriately handle each individual child class.This milestone is dedicated to bug-fixes that are found post-alpha. It will be developed hand-in-hand with a game using the engine.
Create an animation API layered on top of obj::zEntity
. Functionality should be something like this:
obj::zAnimation& Anim = MyScene.AddAnimation();
Anim.LoadFromFile("walk_sprite_sheet.png");
Anim.SetKeyframeCount(4);
Anim.SetKeyframeSize(math::vectoru16_t(24, 52));
Anim.SetKeyframeRate(120);
Which would create a four-frame animated entity from "walk_sprite_sheet.png", in which each frame is a 24x52 block. When updating the animation, a new key-frame will be loaded every 120 frames.
For easily creating games, a GUI level editor would be handy. There is a decent one already created for IronClad, so it may be useful to build off of that.
Prefixing classes with C looks stupid, and is completely unnecessary with namespaces. But, it does appear valid when a user, for example, wants to create a Vector
instance but cannot, because he has done using namespace zen::math
. Thus Vector<int> Vector(1, 2, 3);
does not compile. A "C" prefix just looks generic, so we will prefix with a lowercase "z" character, instead.
CVector
-> zVector
User code:
using namespace zen::math;
zVector<int> Vector(1, 2, 3);
I need to integrate a custom physics engine into Zenderer prior to starting any real work on a game.
Necessary components:
Possibly look into integrating Box2D instead of rolling my own.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.