onox / orka Goto Github PK
View Code? Open in Web Editor NEWThe OpenGL 4.6 Rendering Kernel in Ada 2012
Home Page: https://orka-engine.netlify.com/
License: Apache License 2.0
The OpenGL 4.6 Rendering Kernel in Ada 2012
Home Page: https://orka-engine.netlify.com/
License: Apache License 2.0
Add packages Orka.Windows.SDL
and Orka.Inputs.SDL
using lucretia/sdlada's bindings.
Vulkan only supports the following texture border colors:
OpenGL supports arbitrary colors via procedure Set_Border_Color
in package GL.Objects.Textures
.
See slide 20 of zink_fosdem19.pdf.
If an executor in package Orka.Jobs.Executors
has processed a job and this job has only 1 dependent job (that is, Job.Dependent /= Null_Job and Jobs.Empty
), then process this job on the same executor instead of enqueuing it by calling Queue.Enqueue
. This should make the job graph system a bit more efficient because it should avoid transferring data to another CPU core.
Along the way you should cross the following:
orka_test-test_6_gltf.adb:195:28: prefix of "Access" attribute must be aliased
orka-loops.ads:59:41: internal call cannot appear in precondition of protected o peration
orka-simd-sse4_1-doubles-math.ads:26:7: error: '.builtin_ia32_roundpd' nee ds isa option -m32 -msse4.1
orka-atomics.ads:24:13: error: inlining failed in call to always_inline 'Orka.Atomics.Decrement': function body not available. (note: Did not find proper fix yet.)
I let go even though it looks interesting.
In a separate repository on Github:
Support rendering features of glTF:
Rendering
Extensions
Add support for UBO's, SSBO's, atomic counters, compute shader.
Add retrieving offset and size via tex level parameter (see texture_buffer_range extension).
Add Type_Invariant checks to texture tagged types.
Changing the binding point of an SSBO or UBO is likely not going to be supported. The binding point can be explicitly set in the shader with a layout qualifier.
See Mesamatrix for more extensions that need bindings.
OpenGL 4.6
OpenGL 4.5
OpenGL 4.4
OpenGL 4.3
OpenGL 4.2
OpenGL 4.1
OpenGL 4.0
OpenGL 3.3
OpenGL 3.2
OpenGL 3.1
OpenGL 3.0
OpenGL 1.4
Add a loader that can load .gltf
files that follow the glTF 2.0 specification. Use json-ada for parsing JSON.
Basic structure
3D objects
Data layout
Rendering
Automatic resolve multisampled resources if the resource was written as a FB attachment by blitting the framebuffer. If the resource was written as an image, then so automatic resolving should occur.
For example:
P1 -> R1 -> P2
R1 can be resolved by adding an extra pass that does nothing but a blit operation from the FB of P1 to P3:
P1 -> R1 [-> P3 -> R2] -> P2
The extra render pass should be able to blit mulitple resources (1 color and/or 1 depth and/or 1 stencil). The extra resource (R2) must have the same format.
Function View_Matrix
of type Look_At_Camera
in Orka.Cameras
and type Model
in Orka.Resources.Models
use a rotation matrix to convert positions from structural frame to OpenGL.
This rotation matrix should not be hard-coded, but configurable.
Procedure Load_And_Compile
in Orka.Rendering.Programs.Modules
directly reads files using GL.Files.Load_Shader_Source_From_File
. Instead use the resource system. This will make it easier to enable automatic live reloading of resources in the future.
Add a package Orka.Resources.Locations.Archives
which implements the Location
interface.
Only support ISO/IEC 21320-1:2015 .zip archives.
Use Zip-Ada. Port it to Git and clean it up by removing all the prohibited functionality.
Orka.Resources.Locations.Archives
and update README.md
Load_Texture
in Orka.Resources.Textures.KTX
should be converted to a Jobs.GPU_Job
.
A Loaders.Loader
tagged type should be added which implements a Load
procedure to create and enqueue the GPU job. The old empty Load
at the end of the KTX
package can be removed.
See https://github.com/onox/orka/blob/master/src/orka/implementation/orka-resources-models-gltf.adb#L355-L397 and https://github.com/onox/orka/blob/master/src/orka/interface/orka-resources-models-gltf.ads#L31-L35 for an example.
Add procedures Read_Data
in package Orka.Rendering.Buffers.Mapped
.
Procedure Write_Texture
in Orka.Resources.Textures.KTX
currently uses a hardcoded format RGBA
and data type Float
. Implement GL extension ARB_internalformat_query2
so that these two variables can be inferred from the Texture
object.
Package Orka.Inputs
specifies an interface Pointer_Input
to provide a pointer on the screen. Currently GLFW_Window.Process_Input
in package Orka.Windows.GLFW
modifies the object which implements Pointer_Input
using the position and scroll offset of the mouse.
Package Orka.Windows.GLFW
should be modified so that the pointer can be controlled via a joystick as well. Clients may want to be able to control whether the mouse, a joystick, or both control the pointer. They should also be able to change this at run-time. Note that joysticks can (dis)appear during run-time.
Let clients listen for keyboard and joystick events.
Build a frame graph to allow defining arbitrary rendering pipelines. Manage resource creating/deletion/binding/barriers.
Tasks:
Passes
vector) that have a Side_Effect
or References > 0
so that we don't iterate over unused passes in procedure Render
.Improve the KTX viewer so that it can display textures other than those of kind Texture_2D
:
Texture_1D
Texture_2D_Array
as a grid of Texture_2D
Texture_3D
as a cube (volumetric rendering)Texture_Cube_Map
as a cube and inverted cube (360 deg background)See the links in #13 for more information.
Support animations and vertex skinning features of glTF:
Basic structure
Vertex skinning
If a texture contains multiple mipmap levels, only the first level is written to a KTX file.
Improve the API of tagged type Framebuffer
in package Orka.Rendering.Framebuffers
a bit:
GLFW 3.1 functions:
GLFW 3.2 functions:
GLFW 3.3 functions: (https://www.glfw.org/docs/3.3/news.html#news_33)
May be binded in the future:
GLFW 3.1 functions:
Not binded:
GLFW 1.0 functions:
GLFW 2.2 functions:
GLFW 3.1 functions:
GLFW 3.2 functions:
GLFW 3.3 functions:
Add a Orka.Resources.Textures.KTX
package that is able to load .ktx files. See the KTX File Format Specification.
Currently culling and binding buffers is done for each instance. This should be done once. Refactor Orka.Resources.Models
to improve the efficiency.
Also make sure each instance has a Behavior_Ptr
so that each instance can have an arbitrary implementation of Behavior
and is able to override Fixed_Update
for example. Right now each instance is of the type Model_Instance
, which means the user does not have a way to provide their own implementations of Fixed_Update
, Update
, etc. for physics and/or animations.
glTF has several problems because it was designed for WebGL instead of OpenGL 4.x:
Create a binary storage format:
GL.Types.Indirect.Elements_Indirect_Command_Array
)
When creating a logger, it should be possible to specify the minimum severity of log messages that the logger must log.
Add a new parameter Level : Severity := Debug
to the constructors of Orka.Loggers.Terminal
and Orka.Loggers.Location
.
Debug rendering:
Support rendering debug axes (x = red, y = green, z = blue).
Various data structures are created while loading a glTF model. These need to be cleaned up when no longer needed or if one of the jobs fails.
Created during parse step (GLTF_Parse_Job
):
JSON_Value_Access
GLTF_Data_Access
Created during processing step (GLTF_Process_Buffers_Job
):
Byte_Array_Access
Currently messages can be printed from any task via Orka.Logging.Insert_Message
or from the rendering task via GL.Debug.Insert_Message
(which uses KHR_debug).
Source
and Severity
)Support automatic reloading of resources (shaders, glTF models, KTX textures) if one of the files used to construct a resource has changed.
If reloading fails (e.g. exception is raised in a job), the current resource should remain active.
Automatic resource management, including physical resource aliasing of virtual resources that do not overlap.
Mesa drivers currently return Byte
or Unsigned_Byte
for integer internal formats, even if the component size is 16 or 32 bits (depending on the Internal_Format
(in GL.Pixels
) that is used). For float internal formats, Float
is returned.
Functions Read_Pixels_type
, Texture_Type
, and Get_Texture_type
in GL.Pixels.Queries
never return Short
, Unsigned_Short
, Int
, Unsigned_Int
, or Half_Float
.
See https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/mesa/main/formatquery.c#L609-617
Appropriate data type is required in procedure Write_Texture
in package Orka.Resources.Textures.KTX
.
Compute the data type ourselves instead of calling Get_Texture_Type
in procedure Write_Texture
.
I used GNAT 2017 GPL, clean sync on latest of both json-ada and orka : checkout master.
make build, along the way you should cross the following:
json-ada is not recognized as a package (I did 'make install' for json-ada and I find these libs under /usr/gnat/lib. I do not know what is wrong)
orka-futures-slots.ads:56:21: internal call cannot appear in precondition of protected operation
orka-loops.adb:21:06: file "orka-buffer_fences.ads" not found
orka-loops.ads:63:41: internal call cannot appear in precondition of protected operation
Once fixed finally passed with many warnings though.
make examples:
Once everything changed for Orka.Rendering.xyz most example builds. The execution of those binaries all leads to this:
Execution terminated by unhandled exception
raised PROGRAM_ERROR : gl-objects-renderbuffers.adb:144 access before elaboration
Call stack traceback locations:
0x7f8fab10ed8d 0x7f8fab1145a7 0x40a2de 0x4089e4 0x7f8fa9a07b95 0x408a18 0xfffffffffffffffe
In the light of those errors I propose you amend the Readme to let know the project is still in a WIP phase and might not build. Thx.
p.s: see pull request with all the quick fixes to make it build.
Add a scene graph to compute the world transform matrices of nodes and to perform view frustum culling on the CPU.
Get_Data
and Get_Compressed_Data
in GL.Objects.Textures
assume no PBO is bound and operate synchronously. Refactor these functions so they can operate (only) asynchronously (requires binding a buffer to a PBO and setting a fence).
Get_Data
and Get_Compressed_Data
(bind a buffer as a PBO + set a fence)Orka.Rendering.Textures
(use job graph system)After the fence has been retired, we can either:
Get_Data
in Orka.Rendering.Buffers
The job graph system might need to be modified in order to postpone the execution of the remaining jobs of a job graph until a fence has been retired. Currently we either need to wait on a fence in a GPU job or insert a new GPU job between the current GPU job and the next job in a job graph. However, this new GPU job might immediately get executed by the thread which processes the GPU jobs. Currently there's no way to tell the system to wait until the next frame.
https://on-demand.gputechconf.com/gtc/2012/presentations/S0356-GTC2012-Texture-Transfers.pdf
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.