kvark's picture

First demo of kri-3rd-iteration: DUDE

After several months of development, I'm uploading the first demo of my 3-rd iteration engine.
The Dude.
http://code.google.com/p/kri/downloads/list


Found this model in free access on the internet: 20k vertexes, 52 bones.

    Rendering it in 6.5 passes:

  • (0.5) applying skinning via TransformFeedback
  • (1) filling depth buffer (early z-cull)
  • (1) filling color buffer with emissive component
  • (2) filling exponential shadow maps for 2 lights
  • (2h) applying these 2 lights contribution

Render result is almost indistinguishable from Blender rendering, but still there is work to do with lighting (specular component seems to be higher than it should).
Performance is constant 250 fps on Radeon 4670 HD regardless of a window size.
Of course, deferred Render will fit *much* better to render this high-poly model, and it's now in development.
Anyway the engine aims primarily for low-poly models with parallax maps, so deferring is not strongly necessary.

Engine's features can be found near the download page.
Hope it will run on your machine... Enjoy!

Images
Dude walking in KRI

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Inertia's picture

It shuts down without any error message or other useful information why. The OS install is rather young: Win7 x64 RC1 with all hotfixes, Catalyst 9.9 (Radeon 3870), .Net Framework 4.0 beta 1. Does the demo require any other libraries installed (python or something else)?

the Fiddler's picture

Also crashes here, in the Shader() constructor (soryy, tested only on Mono so no line numbers):

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path "dude/bin/engine/shader/copy_v.glsl".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.File.OpenRead (System.String path) [0x00000] 
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x00000] 
  at System.IO.StreamReader..ctor (System.String path) [0x00000] 
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.OpenText (System.String path) [0x00000] 
  at kri.Shader..ctor (System.String name) [0x00000] 
  at kri.Ant+ShaderLibrary..ctor () [0x00000] 
  at kri.Ant..ctor (Int32 ver, UInt32 wid, UInt32 het, Int32 depth) [0x00000] 
  at demo.MainModule.Main (System.String[] argv) [0x00000]

Couldn't find "copy_v.glsl" anywhere in the zip - some resources are missing?

kvark's picture

Thanks for trying, guys! It's a pity you weren't able to see it...

The demo requires the following:
.net 3.5
proper OpenGL 3.0 support from driver (Catalyst 9.9+ for ATI)

I tried it on a different computer as well and saw the crash. But I really don't know what's happening... I'm not aware much about aspects of .Net apps execution on different computers. Building the same code produces working executable on the computer where I failed to launch the demo.

2Fiddler:
You probably running the app directly, where the working dir is not set up properly. Try launching the run.cmd script from the demo root folder, please.

the Fiddler's picture

Ah, I see. Still fails: dude is trying to load copy_v.glsl from the engine/shaders folder but this file does not exist there (note: there's no engine folder in demo_dude.zip, I used the one from kri-1.95.zip).

The closest match seems to be vp_copy.glsl, which fails with:

Unhandled Exception: System.Exception: Vertex shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 2 compilation errors.  No code generated
 
  at kri.Shader.check () [0x00000] 
  at kri.Shader..ctor (System.String name) [0x00000] 
  at kri.Ant+ShaderLibrary..ctor () [0x00000] 
  at kri.Ant..ctor (Int32 ver, UInt32 wid, UInt32 het, Int32 depth) [0x00000] 
  at demo.MainModule.Main (System.String[] argv) [0x00000]

Ati 4850 with catalyst 9.9 on Ubuntu amd64.

Edit: adding "#version 130" to the shader resolves this issue. However, dude is still looking for non-existent shaders (copy_f.glsl, copy_ar_f.glsl and so on).

kvark's picture

Oh, sorry guys!

I have to supply engine shaders to allow demo to run...
Give me a second to reupload the demo ;)

the Fiddler's picture

Tried the updated version - now it finds the shaders as expected!

The #version issue remains, however:

Unhandled Exception: System.Exception: Vertex shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 2 compilation errors.  No code generated

Ati seems to require the #version 130 directive when using forward-compatible contexts. I haven't cross-checked this with the specs, but IIRC this is the correct behavior.

kvark's picture

Weird things happen around:

* I deleted the old file from google project, uploaded a new one with the same name, but it seems to be the old one now...

* You can not use shaders from kri-1.95, because it's an old version of iteration-2. It was long ago... in C++, it's not compatible with current version.

* You can use shaders from SVN of the project - that's the only one solution for now...

* 9.9 Driver doesn't complain about missing #version in GLSL under Windows by some reason. Adding #version 130 makes numerous compiling errors in fragment shaders with following messages:
"error(#239) Declaration must include a precision qualifier or the default precision must have been previously declared"
I know it can be bypassed by putting 'lowp' before any type mentioning, but it's ridiculous! Do you know a simpler way?

* The current version (that I tried to upload) features complete DualQuaternion-based skinning (on both sides: CPU+GPU) and fixed tangental space of mirrored UV polygons (not too many on this model, so you'll not see the difference).

kvark's picture

Google tricked twice on me :) I though the file wasn't uploaded correctly, but it was just my Chrome's cache containing old archive :)

So, those, who use Windows sometimes, are able to see the demo.
For Linux-based minds, the problem with precision qualifiers remains...

the Fiddler's picture

[#version]
It could be that 9.9 linux drivers are using an older version of the OpenGL stack. This will probably be fixed in 9.10.

[Precision qualifier]
You can add "precision lowp float;" to each shader file (instead of each type). It's still ridiculous, albeit less so.

[Dual quaternions]
I've been reading some material and they look very interesting.

kvark's picture

[version]
No, I think it has to complain about missing version in GL3. My context under Windows doesn't seem to be correct 3.0 (but the logs are OK).

[precision]
thanks, that helped! I can afford 2 lines per shader (version + precision).

[dual quaternions]
As I initially aimed to deal exclusively with quaternions (no matrices!), this new technology fits my engine very nicely. However, I have to admit that the code for DQ is a bit tricky: I'm using just 2 complex optimized operations:
1) form a DQ from weighted 2 spatial transformations (represented by rotation quaternion + position offset).
2) write the normalization result to the output transformation (used math optimizations described in DQ paper to avoid real DQ normalization).

I'm trying to say that If I had DQ fully supported by OpenTK with standard operations like addition, multiplications & normalizations - it wouldn't help me even a bit...