entropia
Entropia.Raytracing
Submitted by xen on Wed, 03/26/2008 - 19:26Recently, there has been some interesting development in realtime raytracing:
- Some realtime demo started to emerge.
- Lot of important companies and people gave their opinion (including NVidia, Intel, Carmack, etc...).
I think neither current GPU or CPU are going to take over each other: GPU have impressive processing raw speed but poor cache/branching management while CPU is the opposite. CPU and GPU should simply converge, and we're likely to end-up having something in the middle to get the best of both world.
As it is really new, there is lot of research going on now. Being very interested in research myself (really considering doing a PhD now), I started a realtime raytracer project, so here we go, newest of the Entropia family is Entropia.RT... not very original, I know (sorry, I have to put Entropia.NET on old for a little while).
I have a few ideas that I would like to try and explore, especially about coherent ray packets tracing and trying to maximize use of soon-to-come 16-way SIMD. If they prove to be efficient I will post more info on it very soon.
Entropia
Entropia is an opensource C# 3D engine, featuring a very flexible and extensible architecture. The Trac development page is available here.
If you are interested in joining the project, don't hesitate to contact me !
Features
- API independant rendering interface (close to DX10)
- Ready for next-gen backend : DX10, OpenGL 3.0 (constant buffers, instancing, no legacy path, etc...)
- Included backend : DX9
- Flexible effect system
- Allow to build complex effect such as shadow mapping, reflection, etc... without specific rendering paths
- Shader variables sharing between multiple objects, with constant buffers and instancing optimizations out of the box
- Layered on top of render API (you can use both of them at same time)
- Flexible serialization
- Entity system based on component aggregation
- Scene editor
- Advanced PropertyGrid built on Windows Presentation Foundation
- WYSIWYG
- Asset pipeline optimized toward fast visual feedbacks (importing a mesh from 3DSMAX is a one-click process, over socket)
- Scripting : Boo supported, C#/Lua to come
In development
- Megatexture
- DB backend (to allow concurrent work on a level) for level editor
- Advanced hidden surface removal (ABT Tree, Hierarchical Occlusion Mapping)
External properties (or how to avoid ugly class with 200 properties related to higher level subsystems)
Submitted by xen on Wed, 12/12/2007 - 05:19I have came across an interesting issue latest days, which I will first describe the naive way !
Let's say I have a Geometry class, which holds GPU hardware buffers and some render variables.
- The next step is realizing that collision data is needed. So let's add a pointer to collision data.
- Then come the time to realize that in editor mode, access to source mesh would be needed. OK. Well, let's add a reference to a Mesh class holding triangle data in system memory.
- Well, now it's time to implement culling. Let's add AABB to the Geometry class.
- Damn, sphere tree would be nice too, since my engine could also support that.
- And again...
- And again...
- Now there is an horrible Geometry with hundreds of definitions to variables that Geometry shouldn't even know about (even though they are for sure logically bound to this geometry, but they break lot of OO principle and add a lot of coupling). In fact, collision and culling system are way higher level than the system in which Geometry is defined. How to escape that hell ?
Well, I realized that a system similiar to WPF with its DependencyProperty and DependencyObject would fit perfectly ! Objects that have such external variables should either inherits from a specific class or have a member of that class, which will act as an external property container. Performance shouldn't be a concern, as it could be very fast (pre-sorted) and it's very high level : bottlenecks should never happens there.
The end result looks like :
geometry.SetValue(SourceMeshProperty, sourceMesh); ICollisionShape collisionShape = geometry.GetValue(Collision.CollisionShapeProperty);
A very nice feature that come from it is the ability to setup delegates to build default value of such properties (WPF could only return a static value independant of the object).
Scripting support
Submitted by xen on Thu, 11/29/2007 - 18:27I have just added a scripting system to the engine. Right now it supports Boo, but it will be extended to C# soon.
It uses coroutine in order to make scripting over frame/time very easy :
- "yield" will suspend execution until next frame.
- "yield StartCoroutine(coroutine)" will add a coroutine to the scheduler, and the calling coroutine won't be resumed before the called coroutine has finished.
- "yield Wait(3.5)" : the engine will wait for 3.5 seconds before resuming the coroutine
Simple example which move the camera every frame :
class Test(IScript): i = 0.0
def Run() as IEnumerator:
while true:
rvs = SceneDesignerContext.Services.GetService(typeof(IRenderViewService)) as IRenderViewService
rvs.Eye = Vector3(40 + i, 40, 40)
i += 0.01
yield
WPF Property Grid (Object Editor) & 3dsMax exporter over socket
Submitted by xen on Mon, 11/05/2007 - 01:53Latest news from the coding front !
- I have implemented a 3ds max export plugin over socket. As a result, exporting mesh is now a one click process, the mesh gets loaded in the scene designer. It should allow for artist to do continuous testing with in-game engine rendering.
- Speaking of the scene designer, I started working seriously on it. More precisely, I'm currently working on a very central component : its object editor. I tried to take advantage of many features of the new C# 3.0 framework, and to be honest, it's really a breeze to develop that kind of advanced UI control with it ! I aim to get a property grid like the one in Microsoft Expression Blend (which is perfect !).
Screenshots of the current version :
Megatextures
Submitted by xen on Mon, 10/08/2007 - 03:22Latest days I've been working on the latest hype (or not) of 3d engine : megatexture ! However, I didn't want it to alter the toolchain with specific texturing tools.
After some thinking, I think I came up with an interesting idea :
- Mega texture (including atlas) is built on the fly, with a given texture block granularity (let's say 32 * 32 texels).
- To avoid wasting resource, tiling is detected via a simple CRC check of texture blocks when a texture is uploaded.
- Texture could also be checked for duplication before uploading (not sure of that, still to be determined).
- UV mapping of objects get remapped at loading.
My hope is to end with a system where you could paint in the middle of a very big tiled texture very easily while consuming minimum texture size. In fact, megatexture, or the idea of virtualizing textures is a neat idea, but some care should be taken (i.e. still use of tiling/texture reuse), because a 32k*32k seems a lot, but stretched over a very big terrain, it could end up with a very bad resolution.
My hope is it will be merged in the source within few days.
Update : After some prototyping, seems to behave fine (no artifact). I gonna take a look at perfhud to check if it's not too heavy (on pixel-shader side). In fact, with bilinear filtering, 8 texture lookups are needed.
Update 2 : Pixel shader complexity was increasing too much. As a result, I switched the way to do it and I ended up with border uploaded. Now pixel shader is basically two tex2D lookup, a frac and few additions/multiplications. It was a bit painful to get perfect mipmaps (including border) without any shifting artifact.
Entropia : Collada, Effect system, ...
Submitted by xen on Sun, 09/23/2007 - 16:18OK, just a little news to let you know that the project is (of course) not dead. I worked a lot on branch, and now everything is merged back. Lot of things has been added and improved, including :
- Collada exporter (don't support scene exporting, only mesh now).
- Advanced effect/shader system, including effect bouncing/forwarding support (check this gamedev thread), allowing advanced effect such as shadow mapping and cubemap reflection to be defined in a generic way (through xml by the way). I'll do a quick demo as soon as I can.
- Serialization engine rewritten, now based on a "node" architecture. It should allow for very great extensibility in the asset pipeline (choice between binary and xml, multi archive support, etc...).
- Expression parser written using Coco/R to parse things such as (World[Inverse]*View)[Transpose] for a later use in the effect system for data driven shader variable binding with xml.
WPF : useful in game development ?
Submitted by xen on Sun, 08/26/2007 - 18:13Latest days, I have spent some time playing with Windows Presentation Framework aka WPF, the presentation layer of the new .NET Framework 3.0/3.5, with Visual Studio 2008 Beta 2.
The learning curve is rather low at the beginning, but once you get used to the basis, it becomes totally exponential.
- Controls are built from other in a tree-like way. By the way, ever checked Microsoft Blend Expression ? It got an awesone PropertyGrid like control, in which you can bind every property to external sources. However, after some investigation, I realized that it should be relatively easy to do one like that in WPF thanks to this tree-like architecture. Note that care has to be taken due to airspace issues between D3D and WPF (a pixel can't belong to both). However, in an editor, controls should be in their own airpsace.
- System.Windows.Data also holds another big stone of their system : their DependencyProperty & Binding system. It could be a great architecture for a game engine (shader variables, entity variables, etc...). I started working on a similiar system. However, performance requirements (thousands of variables updated each frame) made me go the JIT way (binding are compiled at runtime with DynamicMethod).
All of this will be included in the engine some time in the future.
Rewrite of the render layer
Submitted by xen on Tue, 06/26/2007 - 13:39Latest days I've been rewriting the render layer of the project to match D3D10 and upcoming OpenGL Longs Peak.
Sometimes it's hard to keep D3D9 compatibility (especially about index buffer indice size fixed at creation time and stuff like that).
Nevertheless it should end up in an API very optimized toward next-gen hardware. Even if it took some time, it should give me a render framework way more clean to start from.
By the way, I've also written the base of a software depth renderer to use with HOM (Hierarchical Occlusion Culling).
