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
0
votes
1 answer

error c0000: syntax error, unexpected '?' at token '?'

Alright I searched other peoples questions and could not find a solution to my problem. I am using OpenTK in C# and GLSL 330. It is producing the error message error c0000: syntax error, unexpected '?' at token '?' For some reason it doesn't like…
0
votes
1 answer

Unexpected flying boxes while trying to render

So for a quick sample in pictures: This is normal: this is after rotating 180 deg on either the X or Y axis: I don't see why this is happening at all. I'm using OpenTK to render a simple Bullet physics scene. The code is straight forward and it…
mcmonkey4eva
  • 1,359
  • 7
  • 19
0
votes
1 answer

Using VBO/IBOs to draw a large graph

I'm trying to draw a large graph (~3,000,000 vertices, ~5,000,000 edges) using OpenTK. However I can't seem to get it working. I creating a VBO containing the positions of all the vertices like so // build the coords list float[] coords = new…
Brad Zacher
  • 2,915
  • 18
  • 31
0
votes
1 answer

OpenTK vertices seem to always write to 0 in depth buffer

So I have a 2D game engine I was working on adding a depth buffer to so I could draw stuff behind and in front of each other at will. I asked my GameWindow to create a depth buffer on initialization, enabled depth testing, changed the depthFunction…
0
votes
1 answer

Trouble Texturing VBO

It seems as though I am having some trouble with texturing VBOs in my game. The VBO itself, seems to render just fine, and I can even toggle the faces away accordingly. However, when I try to add textures everything looks skewed and some textures…
Krythic
  • 4,184
  • 5
  • 26
  • 67
0
votes
1 answer

OpenTK "Picking" Not Working As Intended

I have attempted to implement picking in my game and I am certain that I am missing something because the picked color always returns either 255,255,255,255 or 255,0,0,0. These two colors seem to happen randomly, and even change when I click on the…
Krythic
  • 4,184
  • 5
  • 26
  • 67
0
votes
3 answers

OpenTK Graphics Card Crashing During Occlusion Culling

I recently implemented Frustum culling in my game, and in an attempt to squeeze every last drop out of my render cycle I also decided to implement Occlusion Culling. It works brilliantly, however, I was distressed to discover that if I dont look at…
Krythic
  • 4,184
  • 5
  • 26
  • 67
0
votes
1 answer

How to draw a triangle with VBO and F#

I am trying to draw a triangle using OpenTK and VBO. But the only thins that appear is a brown background. open System open OpenTK open OpenTK.Graphics.OpenGL4 open OpenTK.Graphics type Window(width, height, mode, title, options) = inherit…
Maxime Mangel
  • 1,906
  • 16
  • 18
0
votes
1 answer

Problems with drawing billboards

I am currently trying to draw billboards and some geometry with "modern opengl approach". Problem is that I cannot force billboards to keep their positions in space. I need to link text positions with positions of another objects. Coordinates of…
frankie
  • 728
  • 1
  • 10
  • 28
0
votes
1 answer

OpenTK/OpenGL blending semi-transparent texture issues

I am working on a 2D menu for a game using OpenTK in C#. At the moment, the menu is separated in 3 different texture quads, or 'layers', which looks like this. Layer 1: The base appearance of the buttons. Layer 2: The appearance of the 'continue'…
NyteQuist
  • 11
  • 3
0
votes
0 answers

Using OpenTK in a Gtk# window

I'm trying to use OpenTK via a window in GTK#. Xamarin Studio doesn't have any native GL controls loaded normally, so I tried loading GTKSharp directly from the DLL. Then dragging over the control Results in an error. Has anyone managed to get…
wonea
  • 4,783
  • 17
  • 86
  • 139
0
votes
2 answers

Texture mapping an entire image when only some inner pixels have corresponding coordinates

I have an image which I want to use as texture in my OpenTK (.NET wrapper for OpenGL) application. I don't know the world coordinates of the corners of the image but only some pixels inside the image. Here's my code (_overlay is the image I'm…
Dina
  • 1,346
  • 1
  • 15
  • 35
0
votes
1 answer

I have a plane in 3d using how to pick a point on the plane using mouse

using Opentk in c# to draw square grid with XY and Z. Now how to pick a point on the grid using ray casting method. How can i get the point on the square with respect to the mouse coordinates. Any help will be appreciated. Viewport is as follows: …
user1104168
  • 3
  • 1
  • 4
0
votes
1 answer

Multisampling framebuffer incomplete and I don't know why

this my code to create a "Surface": private void Create(int width, int height, SurfaceFormat format) { bool multisample = format.Multisample > 1; if (multisample) GL.Enable(EnableCap.Multisample); int samples = Math.Max(1,…
pixartist
  • 1,137
  • 2
  • 18
  • 40
0
votes
1 answer

Why is the default viewspace in OpenTK from -1 to 1?

I'm rendering a texture to screen with this code: if (beganDraw) { beganDraw = false; GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0); if (CameraMaterial != null) { …
pixartist
  • 1,137
  • 2
  • 18
  • 40