tksuoran's picture

RenderStack C# preview

An initial C# version of RenderStack is now available from http://neure.ath.cx/renderstack_new/

Currently there is not much documentation and only few examples.

Feedback is welcome.


Comments

Comment viewing options

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

Hello, ...

I want to try your project but to execute all the examples I always get the same error "An exception occurred in the type initializer for 'OpenTK.DisplayDevice'." in this line of code OpenTK.DisplayDevice chosenDisplay = OpenTK.DisplayDevice.Default;

My system:

Microsoft Windows 7 Ultimate 32 bit
Graphics: ATI Radeon HD 3800 Series [ version: 3.0.10524 Context Compatibility Profile]

Any ideas to solve the problem?

Miguel

tksuoran's picture

The copy of OpenTK included in RenderStack is a snapshot from SVN (with small modifications). I have taken the latest SVN version today and minimized my changes; You can redownload the archive (sorry, same name). and try again.

I also dropped forward compatible and debug flags from graphics context, I'm not sure if that could help with some compatibility issues. Let me know if the new version works any better.

Are you able to run any other OpenTK programs?

flopoloco's picture

This project seems very good, it's just what I had in mind for a game engine. But this way seems very handy for a general purpose visualization toolkit. Good work, well done ! :)

I downloaded the archive
version 11.06, June 12, 2011

And it compiled great, however when I tried to run example.Scene it did not work.

 Information: 0 : Initializing Renderer (4 left)
 Information: 0 : Initializing TextRenderer (3 left)
 Error: 0 : Program.LoadFromFiles(res/shaders/Textured.gs, res/shaders/Textured.vs, res/shaders/Textured.fs, ) failed - exception System.EntryPointNotFoundException: Unable to find an entry point named 'glBindFragDataLocation' in DLL 'opengl32.dll'.
   at OpenTK.Graphics.OpenGL.GL.Core.BindFragDataLocation(UInt32 program, UInt32 color, String name)
   at OpenTK.Graphics.OpenGL.GL.BindFragDataLocation(Int32 program, Int32 color, String name)
   at RenderStack.Graphics.Program.LoadFromFiles(String geometryShader, String vertexShader, String fragmentShader) in c:\Users\draghp\Downloads\renderstack-11.06\renderstack-11.06\technologies\RenderStack.Graphics\Program.cs:line 331
 Error: 0 : Program.Load(Textured) failed - exception System.EntryPointNotFoundException: Unable to find an entry point named 'glBindFragDataLocation' in DLL 'opengl32.dll'.
   at OpenTK.Graphics.OpenGL.GL.Core.BindFragDataLocation(UInt32 program, UInt32 color, String name)
   at OpenTK.Graphics.OpenGL.GL.BindFragDataLocation(Int32 program, Int32 color, String name)
   at RenderStack.Graphics.Program.LoadFromFiles(String geometryShader, String vertexShader, String fragmentShader) in c:\Users\draghp\Downloads\renderstack-11.06\renderstack-11.06\technologies\RenderStack.Graphics\Program.cs:line 360
   at RenderStack.Graphics.Program.Load(String fullpath, Program program) in c:\Users\draghp\Downloads\renderstack-11.06\renderstack-11.06\technologies\RenderStack.Graphics\Program.cs:line 117
   at RenderStack.Graphics.Program.Load(String filename) in c:\Users\draghp\Downloads\renderstack-11.06\renderstack-11.06\technologies\RenderStack.Graphics\Program.cs:line 87

I will try later to download from SVN in case it is updated better.

tksuoran's picture

The Scene calls RenderStack.Graphics.Configuration.GL3 = true; in Program.cs line 63. This triggers code path in RenderStack.Graphics/Program.cs line 170. If your graphics card doesn't really support GL3 then this is not going to work. In the error message "Unable to find an entry point named 'glBindFragDataLocation'" hints that your driver might not have GL3 support.

A few options to fix:
- Scene example could test for GL3 and abort if it not found. Not nice for those who have older graphics cards or drivers.
- Modify scene example shader to only use GL2. Not nice if you want to promote GL3.
- Hack the shader compiler to "backport" GL3 shader sources to work with older GL version. There is actually some code in RenderStack.Graphics/Shader.cs, look out for SHADER_COMPATIBILITY_HACK define. But this relies on conventions not really documented anywhere (except Shader.cs source), so I have disabled it as it is not general purpose and only works with shaders I have written.

migueltk's picture

I downloaded a OpenTK SVN snapshot, I have compiled, and everything works fine. RenderStack I downloaded again from your website and I still get the same error.

tksuoran's picture

Fiddler, would you happen to have any ideas?

tksuoran's picture

flopoloco, I've updated the zip with GL 2.1 compatible codes. The shaders are now GLSL version 120 and there was also a small issue with Framebuffer. As a bonus the examples have now been tested in Ubuntu 11.04 (running in vmware) with monodevelop, the scene example currently needs manual copy for res files though.

migueltk, can you try to drop the OpenTK project reference and add OpenTK.dll from elsewhere as reference instead?

migueltk's picture

Really curious, I added a reference to OpenTK.dll as indicated tksuoran and everything works fine.I do not understand!. Thanks for the help.

tksuoran's picture

Glad to hear that helped, even though I don't quite understand why. Must be something in the way OpenTK.dll is built..

flopoloco's picture

I finally got it to work. It's strange though, I have nVidia 256 GTX
RenderStack.Graphics.Configuration.GL3 = false;