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

glsl VertexShader/FragmentShader refuse to compile in OpenTk c#

I have followed this tutorial to try and learn OpenTK (https://www.youtube.com/watch?v=elEyLoQQ67o&t=1182s) My code is pretty much identical to his but when the program is run, both the fragment-shader and the pixel-shader fail to compile with the…
Radergummi
  • 23
  • 3
2
votes
1 answer

OpenTK doesn't render the color of my triangle

I am learning to program a game engine which is why I followed a tutorial, with that tutorial I have gotten this far and even though my code is identical to theirs (theirs did work in the videos) its not working the way it is meant to. The triangle…
R3_VT
  • 23
  • 3
2
votes
1 answer

OpenTK triangle not drawing

I have been following a tutorial but the triangle doesn't show up for me and I have no idea what is wrong with my code for the triangle not to be appearing. I am using OpenTK version 4.7.1 Here is my code: This is Window.cs Here is where I write…
2
votes
0 answers

Create window with GLFW or openTK GameWindow

To create a window I got to find two approaches: 1.- With the brand new GLFW-based windowing and intput systems: class Program { static unsafe void Main(string[] args) { GLFW.Init(); Window* window = GLFW.CreateWindow(800, 800,…
rustyBucketBay
  • 4,320
  • 3
  • 17
  • 47
2
votes
1 answer

how am i supposed to use multiple buffers in OpenGL

i want to use different arrays to store different data like the color postion and texture coords from my mesh but when i try and bind multiple buffers nothing is showing on screen. if you have any idea on thow to fix please let me know this is my…
Murten101
  • 23
  • 3
2
votes
1 answer

Opentk showing black screen instead of triangle

I have created a simple application to display a triangle, but it only shows black window. class Program { static void Main(string[] args) { GameWindow window = new GameWindow(800,600); game game = new…
Pravin
  • 33
  • 3
2
votes
1 answer

Projecting and offseting vertices in shaders in OpenTK 3.3

I am trying to get to work a polygon class for OpenGL using OpenTK. The goal is to make an instance of the class, pass it an array of vertices in pixel coordinates, and have it drawn to the screen properly. The way I intend to achieve this is to use…
user14120696
2
votes
1 answer

Not sure how to properly use Matrix4.LookAt in this situation

I am experimenting with ray marching, and have been following Jamie Wong's tutorial. When the moving the camera section comes, they use the function mat4 viewMatrix(vec3 eye, vec3 center, vec3 up) { vec3 f = normalize(center - eye); vec3 s =…
Salmon
  • 33
  • 4
2
votes
1 answer

VBOs Using Interleaved Vertices in C#

I am trying to use VBOs to draw my model in in C# using OpenTK. In my online research I read in many places that it is good practice to make the size of the interleaved data structure an exact multiple of 32 bytes, so I coded up the…
seveland
  • 181
  • 12
2
votes
2 answers

Why does my OpenGL ES app crash on glDrawElements?

I have developed a mobile game with OpenGL ES 3 on Xamarin (Which uses OpenTK). It's running fine on most devices, but crashes on some devices (HUAWEI Y5 lite). Unfortunately I don't get a detailed log of the error: #00 pc 0000000000093d2a …
Snaketec
  • 471
  • 2
  • 14
2
votes
2 answers

OpenTK, pass array of vectors into a shader

So I have an array of OpenTK.Vector3 that I want to pass into a shader, but it seems that GL.Uniform3 has no overload for that. How should I go about doing this? I want to use an unsized array, and iterate over it in the shader Frag Shader: #version…
2
votes
1 answer

Passing data from C# to OpenTK FS

I'm coding a pong game entirely in the fragment shader of OpenTK. C# does all the grunt work and then passes the info to the fragment shader so that it colors the correct pixels. Problem is, I have no idea how to pass information to the fragment…
2
votes
1 answer

Updating bufferarray every frame OpenTK

I am drawing an object in OpenTK that keeps changing position in each frame. For now, I keep changing the position array and buffering the new data by calling GL.BufferData. Is there a way where I can update or map to one buffer array without making…
FATzz
  • 83
  • 5
2
votes
1 answer

OpenTK Oblique Frustum (Lens Shift)

I am very new to OpenGL and am using the latest version of OpenTK with C#. My camera class currently does the following, public Matrix4 GetProjectionMatrix() { return Matrix4.CreatePerspectiveFieldOfView(_fov, AspectRatio, 0.01f,…
Khal
  • 23
  • 1
  • 4
2
votes
1 answer

OpenTK GLControl problems

I have recently updated the nuget package of OpenTK to the version 3.2.0 and I have the version 3.1.0 in the OpenTK.GLControl package. Since then I been having seriuos problems to run my app. I´ve tried everything but when I try to add a Glcontrol…
Jaime
  • 131
  • 9