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

OpenTK / OpenGL : Unable to Get Shaders to Run on VAO

I'm trying to run a shader over my mesh. Right now it's all 2D and pretty simple. I think it's just a lack of knowledge on my part that's the issue but after 4 hours of google and reading through opentk / opengl tutorials I'm still stuck. Here's my…
Euan Hollidge
  • 587
  • 2
  • 5
  • 21
2
votes
1 answer

How to set OpenGL Orthographic Projection to fill screen with a rectangle when rotated

Can anyone please help me with the following? Simply put: I have a rectangle geometry defined by 4 vertices {x,y,z} as follows: double[] vertices = new double[12] { -5, 3, 0, 5, 3, 0, 5, -3, 0, -5, -3, 0 }; I draw the rectangle with the…
user3738290
  • 445
  • 3
  • 16
2
votes
1 answer

Drawing from a list of vertices using OpenTK/MonoTouch?

This is a very simple and straight forward question, I realize that, but I've been mulling over google searches and haven't really found an answer to what I thought would be a simple question. I have a class called vertex, defined as such: class…
meds
  • 21,699
  • 37
  • 163
  • 314
2
votes
1 answer

How to embed SDL video in an existing OpenGL project

I'm working on an OpenGL game, and would like to play video on 3D surfaces within the game. SDL seems to be an excellent choice for video playback, but is it possible to create the surface inside of an existing OpenGL context? How would I go about…
bbosak
  • 5,353
  • 7
  • 42
  • 60
2
votes
0 answers

Problems setting up OpenTK in Visual Studio

I am going to develop with OpenTK in Visual Studio 2019 to develop 3D graphics with WinForms and make a windows application. However, I am having great difficulty getting it set up correctly. I have installed the OpenTK with NuGet in VS and it's…
C. K.
  • 71
  • 1
  • 11
2
votes
1 answer

OpenTK orthographic projection with left top origin

How do I setup openTK so I get a orthographic projection where: The origin is in the top left corner of the screen I can use "normal" pixel coordinates, for instance: if my window is 500 X 400 then: 0,0 is the top left corner 500,0 is the top…
lsie
  • 23
  • 4
2
votes
0 answers

OpenGL - Cannot get cumulative rotation around correct axis and origin

I am implementing an Arcball rotation in an existing project I wrote several years ago, using OpenTK & C#, and have got stuck at the final hurdle. This is 'old-style' non-shader OpenGL. I am confident that the Arcball rotation is working correctly,…
wotnot
  • 261
  • 1
  • 12
2
votes
0 answers

Calculating the final bone transformation for a skeletal animation

I have a simple model with a simple skeletal structure that I made in blender. Here's how it looks: And here's the hierarchy in blender: As you can see it has two bones: One that goes halfway up the rectangular box ("Bone"), that is completely…
Dan
  • 257
  • 1
  • 3
  • 11
2
votes
1 answer

System.AccessViolationException in any OpenTK.Graphics.OpenGL4.GL Methods

I'm currently learning OpenTK(v 3.1). But there is a problem. System.AccessViolationException is always thrown when I call GL.~~~() functions. using System; using OpenTK.Graphics.OpenGL4; namespace OpenTKTut { internal class Program { …
A-H4NU
  • 71
  • 4
2
votes
0 answers

How can I get the worldspace coordinates of a pixel on a texture?

I need to be able to get the coordinates of a pixel under the mouse to ensure that when I calculate the distance between 2 points, it ends up being the correct distance. My issue is that when I try to translate the texture, the mouse (drag based…
DaDuStMaN20
  • 137
  • 2
  • 11
2
votes
0 answers

How do I render a scene to a cubemaptexture and then use the cubemaptexture in another shader as cubesampler?

I am writing a 3D engine that uses Phong shaders and point lights in C# using the OpenTK library (OpenGL). I am now trying to create a shadowmap (cubemap) of the scene for each light I have, but I don't know how to see if the rendering of the…
2
votes
1 answer

Cubemap in OpenTK

Warning: Total OpenGL/TK newb, so be kind. I may have bitten off more than I can chew. Specs: Visual studio Community 2017 C# .Net 4.6.1 (using WPF, WindowsFormsHost control) OpenTK 3.0.1 OpenTK.GLControl 3.0.1 I am trying to replicate the…
TheLastGIS
  • 426
  • 5
  • 18
2
votes
1 answer

Previous calls to GL.Color3 are making my texture use the wrong colors

Making a 2D OpenGL game. When rendering a frame I need to first draw some computed quads geometry and then draw some textured sprites. When the body of my render method only draws the sprites, everything works fine. However, when I try to draw my…
Dejas
  • 3,511
  • 4
  • 24
  • 36
2
votes
1 answer

vTextCoord value is not working - c# OPENTK

My app is displaying an image in full screen by using OpenGL shader code as shown below. The vertex shader I used here is copied from somewhere. Can anyone explain why here used vTexCoord = (a_position.xy+1)/2;? When I'm trying with vTexCoord =…
nsds
  • 961
  • 4
  • 13
  • 39
2
votes
2 answers

How to correctly render meshes in separate opengl array objects?

I am trying to render two triangles using separate Vertex Array objects. I am using OpenTK on C# (it provides almost the same API compared to defined OpenGL API). Here is my code: I start from declaring my variables. public partial class Form1 :…
Ivan P.
  • 832
  • 2
  • 9
  • 26