Questions tagged [opentk]

The Open Toolkit is an advanced, low-level C# library that wraps OpenGL, OpenCL and OpenAL. It is suitable for games, scientific applications and any other project that requires 3d graphics, audio or compute functionality.

The opentk toolkit wraps OpenGL, OpenCL, OpenAL to C#. This is done using types aiming to make development less error-prone.

The project ships with additional code for instance to render OpenGL graphics on a System.Windows.Forms.Form dialog or control together with loaders for various format.

The project is licensed under the MIT/X11 license.

References

Tutorials and examples:

972 questions
6
votes
1 answer

Don't serialize properties with no setter

I need to serialize objects (OpenTK.Vector2) containing properties with a getter but no setter. I would like these properties to be ignored in general, otherwise I end up with hugely inflated JSON from an object that has two relevant pieces of data…
Little Endian
  • 784
  • 8
  • 19
6
votes
1 answer

gdiplus.dll not found when using MonoKickstart on OSX

I have been using MonoKickstart to get our project - which is built on OpenTK - running on OSX. I got the program to work entirely, but once I removed my Mono.framework (well, actually renamed) the following error popped up: [ERROR] FATAL UNHANDLED…
Tom
  • 532
  • 5
  • 19
6
votes
2 answers

OpenTK/OpenGL Frustum Culling Clipping Too Soon

I just recently added frustum culling to my voxel game; it worked pretty well at first glance. However, I immediately noticed that the frustum seems to be a little off—being that some voxels near the edge of the window are prematurely cut-off,…
Krythic
  • 4,184
  • 5
  • 26
  • 67
6
votes
1 answer

Setup of matrix for instance shader

I want to draw instanced cubes. I can call GL.DrawArraysInstanced(PrimitiveType.Triangles, 0, 36, 2); successfully. My problem is that all the cubes are drawn at the same position and same rotation. How can i change that individually for every…
fedab
  • 978
  • 11
  • 38
6
votes
1 answer

OpenGL - poor performance with high scale values

I'm observing a strange phenomenon with my OpenGL-program which is written in C#/OpenTK/core-profile. When displaying mandelbrot-data from a heightmap with ~1M vertices the performance differs dependant on the scale-value of my view-matrices (it's…
freakinpenguin
  • 831
  • 14
  • 24
6
votes
1 answer

C#. OpenTK same code as OpenGL?

I'm thinking about learning OpenGL with C# and i'm planning to use OpenTK. I'm wondering if the code is the same for OpenTK and "real OpenGL"?. Do i have to read books/tutorials on OpenTK or can i read about OpenGL and still learn to code with it in…
user1621127
  • 301
  • 1
  • 3
  • 11
5
votes
2 answers

MonoTouch OpenTK and UniformMatrix4

I'm trying to pass an OpenTK Matrix4 to a shader uniform, but there doesn't seem to be a suitable overload for GL.UniformMatrix4. The overloads accept either float or float[] or ref float. Similarly I can't find a way to convert a Matrix4 instance…
Brad Robinson
  • 44,114
  • 19
  • 59
  • 88
5
votes
1 answer

Texture is lacking colors

I have a following picture: Window displays two textures, the left texture is generated by binding it to a FBO and rendering to FBO, 50 random triangles. The right texture is generated by glTexImage2D with full-color image of Mona Lisa, but as you…
Lu4
  • 14,873
  • 15
  • 79
  • 132
5
votes
3 answers

To use or not to use VSync

I'm deciding on whether or not to use VSync for a new game that I've been developing using OpenGL. The goal is to provide the user with the best gaming experience, and to have a good balance between performance and quality. This game is designed to…
bbosak
  • 5,353
  • 7
  • 42
  • 60
5
votes
1 answer

Collision checking on slopes

I'm working on a new game, and am trying to detect whether or not the player (on a slope) is colliding with a given mesh based off of their coordinates relative to the coordinates of the slope. I'm using this function, which doesn't seem to be…
bbosak
  • 5,353
  • 7
  • 42
  • 60
5
votes
5 answers

C# - A faster alternative to Convert.ToSingle()

I'm working on a program which reads millions of floating point numbers from a text file. This program runs inside of a game that I'm designing, so I need it to be fast (I'm loading an obj file). So far, loading a relatively small file takes about a…
bbosak
  • 5,353
  • 7
  • 42
  • 60
5
votes
1 answer

How can I debug OpenTK?

Trying to make a game but textures never reach the screen. Using just colors for quads works but when I try to texture the quads, it just shows up as black squares. basic fragment shader: #version 300 es precision highp float; uniform sampler2D…
jklw10
  • 117
  • 7
5
votes
2 answers

Load image in .Net Standard

I am trying to load a png file (other formats are an option) for rendering as a texture in OpenTk in a project targeting .netstandard 1.4, which does not support the System.Drawing libraries. Every OpenTk example I can find for this depends on the…
Kelson Ball
  • 948
  • 1
  • 13
  • 30
5
votes
2 answers

Cloo OpenCL c# Problem

I am trying to get a simple Cloo program to run but it is not working, can anyone tell me why? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using…
Jamie
  • 1,005
  • 5
  • 16
  • 25
5
votes
1 answer

How to profile OpenTK C# application with CodeXL?

I wanted to switch from gDEBugger to CodeXL as CodeXL is the successor of gdeb and even has Visual Studio integration. However, there are some problems with the integration for me. I'm using VS2013, the most recent CodeXL version and compile against…
Ray
  • 7,940
  • 7
  • 58
  • 90
1
2
3
64 65