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
4 answers

How to apply a vertex shader to all vertices in a scene in OpenGL?

I'm working on a small engine in OpenTK right now, and I've got shaders working so far. I wonder though , how it is possible to apply a shader to an entire scene!?. I've seen this done in minecraft for example, where someone created a shader that…
pixartist
  • 1,137
  • 2
  • 18
  • 40
0
votes
1 answer

Multi-Threading cannot access this.close()

So I understand that you are only allowed to access a UI control from the thread it was created on, but I am getting an error complaining about the line 'this.Close()'. What I am trying to do is start a thread that opens a splash screen with an…
TheBlindSpring
  • 631
  • 5
  • 22
0
votes
1 answer

How to implement simple 2D translation on OpenGL ES 2.0 using OpenTK for android

I am trying to add the translation to a simple example of drawing a triangle using OpenGL ES 2.0 for Android. I have created translation matrix with 0 translation in all directions which should be the identity matrix. When I remove the…
0
votes
1 answer

How to find the nearplane size of a projection matrix?

This function is supposed to give me the exact size of my near clipping plane. public Vector2 NearplaneSize { get { float w = 2 * Mathf.Tan(Mathf.Deg2Rad(Fov) / 2) * ZNear; return new Vector2(w, w /…
pixartist
  • 1,137
  • 2
  • 18
  • 40
0
votes
1 answer

OpenTK triangle is always white

I want to draw a colored triangle in OpenTK using a simple fragment shader with a fixed output color. However, the triangle always stays white. What causes this problem? Here is the init and render code: game.Load += (sender, e) => { game.VSync…
snOOfy
  • 33
  • 6
0
votes
1 answer

OpenTK omitting last index in elementbuffer?

I have a Cube mesh defined like this: public GameObject CreateCube(Vector3 size, Vector3 position) { GameObject result = App.CreateGameObject("Cube"); Mesh m = result.AddComponent(new Mesh()); size…
pixartist
  • 1,137
  • 2
  • 18
  • 40
0
votes
0 answers

OpenGL Texture Mapping works with Texture Unit 0 but not Texture Unit 1

I'm using OpenTK (.NET wrapper around OpenGL), and have a GLControl in a form. I've used the Loading a texture from disk and Loading multiple textures and passing through to a shader tutorial to get texture mapping working. But when I try to to set…
Protongun
  • 3,230
  • 1
  • 15
  • 13
0
votes
1 answer

I'm struggling to create a ModelViewProjection matrix in OpenTK

I'm trying to create a modelview projection matrix for my shader like this: I'm getting the matrix for the camera translation: public Matrix4 GetMatrix() { return Matrix4.LookAt(Position, LookingAt, Vector3.UnitY); } Postition is the current…
pixartist
  • 1,137
  • 2
  • 18
  • 40
0
votes
3 answers

OpenTK projection Moving and Scrolling camera

I am writing graphical 2d editor and i am using OpenTK as rendering engine. I wandering how could it possible to move and scroll the camera with the mouse to look like it is done in Photoshop. Here is the code i have for now. …
Alexey Gapon
  • 73
  • 2
  • 11
0
votes
1 answer

OpenTK crashing as soon as I use OpenGL

I'm using OpenTK to make a C# OpenGL application. I'm trying not to use the GameWindow class to open a context - here is my class managing a window + context : using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL4; using…
xtrium
  • 64
  • 6
0
votes
1 answer

OpenTK ES20 Android MissingMethodException

I've been attempting to make an OpenGL ES2.0 (Using OpenTK) renderer for Android that I can also use on iOS. To do this I'm trying to use the latest release of OpenTK on a Xamarin Android project. Only I've hit a problem when trying to use the…
Joseph Little
  • 921
  • 3
  • 13
  • 22
0
votes
1 answer

Retrieving the projected 2d coordinate from the 3d coordinates in opentk

I have my C# sample code posted at: opentk pitch rotation deforms the shape As you can see in the code, I can draw and rotate the 3d object. What I want to do is: Given a 3d coordinate (x, y, z), how to get the projected 2d coordinate (x, y)? Here…
max
  • 9,708
  • 15
  • 89
  • 144
0
votes
1 answer

DrawRangeElements don't draw in proper way

I am trying to draw with DrawRangeElements function, but for some reasons it don't draw part of elements. For example, I have 156 points. My each element contains 52 points (3 elements x 52 points = 156 points). Consider such code: //points…
frankie
  • 728
  • 1
  • 10
  • 28
0
votes
2 answers

OpenTK Depth test not working

I'm having an assignment in my Computer Graphics class to write a 2.5D map using openTK. When I tried to to enable gl_Depth_Test for my drawing, it's doesn't work as expected. The 3D shapes overlap each other and the result is the same when I change…
minhnhat93
  • 141
  • 1
  • 2
  • 13
0
votes
1 answer

OpenTK Primitive type switching in immediate mode

I can't post images because I don't have enough reputation, so only links are provided. I'm using OpenTK to render a 3D model (importing it works fine). The model was made in sketchup and the edge lines are also exported. When I try to render it,…