meta4d-me / catdogengine Goto Github PK
View Code? Open in Web Editor NEWA cross-platform game engine/editor written in modern C++ (WIP)
License: GNU General Public License v2.0
A cross-platform game engine/editor written in modern C++ (WIP)
License: GNU General Public License v2.0
Currently we do not have a way to render terrain other than a demo one. This task captures all the effort to bring Terrain related rendering to this engine.
So a bgfx shader converted hlsl may fail to compile while converted glsl succeed to compile.
Light scattering is the basic thing to describe the color of the sky.
A project should have a config file about:
Based on my experience,
If you are not familiar with CatDogEngine, build bgfx + sdl in android maybe easier for you to learn.
To improve coding details:
const
or already rvalue
.
To adopt modern cpp features:
To add basic infrastructure:
1.A resource manager holds every resource handles in bgfx. Any renderers can use string to find the expected one.
2.As RenderGraph talk said, I need to split resource compile stage away from render logic!
When compiling as hlsl, variables cannot be initialized outside the function with expressions that contain other variables.
For example:
float test = 0.5
is ok to compile in every case, but float test2 = test * test
will cause an compile error in hlsl case.
I haven't tested all cases, but float test2 = test * test
is ok to compile in glsl, spirv and pssl case.
What's worse is that even write float test = 0.5
and compile it to hlsl, the value of test is actually 0.
TODO:
Asset Data
Runtime
References
Do it later as it has more work to do than I thought.
What we need to do in the engine side?
As bgfx doesn't support RTX, can we have another way to integrate them? And have a look at bgfx's status on RTX.
I remember there is a way to describe what should show in the watch list. Forget its name...
How to manage them effeciently? If you just store all entites in the array, then you need to loop through its components by n * O(1) hashmap query to decide how it looks like?
Entt has a class Registry design which we can have a look.
Current we only have one large terrain that's generated with the following parameters:
With these parameters, we will generate a single mesh composed of many triangles with varying heights samples from Simplex2D noise function. This issue focuses on breaking these up into individual mesh with no seams in between. These sectors will only be sent to render if it's within the range of the viewing frustum.
TerrainRenderer
will only send near-by meshes to render. Specifically it should be the ones intersecting with the view frustum.Given the generated terrain meshes with their LOD, we need to support the picking of the right LOD at render time.
It is for convenience to include cmake.exe and other things. Looks strange in the homepage about cmake 95%.
In general, it is a two direction conversion feature about ImGuiWindow <-> Window.
fs_SingleScattering_RayMarching.sc
void main()
{
vec3 rayStart = u_cameraPos;
vec3 rayDir = normalize(v_worldPos.xyz);
// lightDir was optimized here
vec3 lightDir = normalize(-u_LightDir);
// We assume that camera always in atmosphere.
vec2 atmIntersection = RaySphereIntersection(rayStart, rayDir, _PlanetCenter, _PlanetRadius + _AtmosphereHeight);
float rayLength = atmIntersection.y;
// It is ok to put here
// vec3 lightDir = normalize(-u_LightDir);
// If ray intersect whith the earth.
vec2 earthIntersection = RaySphereIntersection(rayStart, rayDir, _PlanetCenter, _PlanetRadius);
if (earthIntersection.x > 0.0) {
rayLength = earthIntersection.x;
}
vec3 inscattering = IntegrateInscattering(rayStart, rayDir, rayLength, lightDir);
vec3 color = PostProcssing(inscattering, 0.0);
gl_FragColor = vec4(color.x, color.y, color.z, 1.0);
}
Write a framework for tests? Or use google-test, ...
Material CreateMaterial() {
Material material;
material.albedo = vec3(0.99, 0.98, 0.95);
material.normal = vec3(0.0, 1.0, 0.0);
material.occlusion = 1.0;
material.roughness = 0.8;
material.metallic = 0.2;
material.F0 = vec3(0.192, 0.192, 0.192);
material.opacity = 1.0;
material.emissive = vec3(0.0, 0.0, 0.0);
return material;
}
For a game engine, the best testing about performances and features is to make a game.
Currently, I only added drag and drop in the SDL level to import assets conveniently.
It is better to drag and drop to different child ImGui windows.
We want to avoid using bgfx as the only one RHI for this game engine. As bgfx is a compatiable RHI, not an advanced one.
So it has some works to remove dependencies from bgfx. And consider to use new RHI with same shaders from bgfx. Also, we are happy to try to reuse some codes in the rendering logic side.
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.