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

OpenGL Invalid Operation

I'm having an issue loading/assigning interleaved vertex data in OpenGL. I keep getting an INVALID_OPERATION when setting the second attribute. EDIT Turns out this only happens on Mac. On Windows, I don't get an INVALID_OPERATION error. But I…
Gabriel Reiser
  • 402
  • 5
  • 10
0
votes
0 answers

OpenTK Ortho Camera causes objects not to show

I'm trying to draw objects on my screen in 2D and translate them on a pixel by pixel bases. Here is my render code, and for some reason it's not showing my objects anymore. It showed them before I added the Ortho Camera. What's going on? Thanks! …
Wezley
  • 413
  • 1
  • 3
  • 19
0
votes
1 answer

Translating Object in OpenTK

Hello I'm currently using the Vector3 translation = new Vector3( tx, ty, tz); GL.Translate(translation); Way of translating an object in OpenTK where the Vector3 values are from -1 to 1 How do I change this and make the values of a…
Wezley
  • 413
  • 1
  • 3
  • 19
0
votes
1 answer

C# OpenTK - How do i render Text on screen

I have been looking for the answer for this question for a long time, but i have not found any good answers yet. So that is why i decided to go on Stackoverflow to ask you guys. I only want to render simple text like "Hello World" on to my OpenTK…
Woljix
  • 15
  • 4
0
votes
0 answers

gDebugger doesn't show allocated textures with OpenTK

i'm using OpenTK warpper for C#, shaders weren't running correctly (i want to generate vertex displacement shader using textures), so i pretend to use a gpu debugger to see what was happening. The application is quite simple. It just creates a game…
Nak
  • 25
  • 7
0
votes
0 answers

OpenGL - displacement vertex shader

I'm working with OpenTK wrapper and C# and trying to use displacement vertex shaders to generate 3D models. I can run dummie shaders to render cubes and triangles, but now I want to create a 3D grid using texture data. For first attempts I created…
Nak
  • 25
  • 7
0
votes
1 answer

Binding OpenGL vertex buffers per frame for multiple meshes

I'm making and OpenGL application that has MULTIPLE meshes that are described as lists of positions, normals, and uvs. I am binding these data to a vertex buffer but I was wondering how I would draw these meshes per frame without re-binding the…
user3551745
  • 33
  • 2
  • 9
0
votes
1 answer

OpenGL transformations not working as expected

I'm writing an OpenGL application (C# and OpenTK) and I'm confused about how OpenGL transformations work. I've set up a perspective projection and I'm at the default location with the default orientation (+X to the right, +Y up, +Z coming at me.)…
Reticulated Spline
  • 1,892
  • 1
  • 18
  • 20
0
votes
1 answer

OpenGL texture rendering - only upper left pixel is displayed

I working with C# and OpenTK. Currently I only want to map a texture on a triangle. It seems to be working but on nearest texture filter, the whole triangle is only colored with the upper left pixel color of the bmp image and if I set the texture…
user3325226
  • 329
  • 2
  • 5
  • 10
0
votes
1 answer

OpenGL texture+lightning+blending trouble

I'm using OpenTK and there is a difficulty for me to understand the concept of openGL enabling functions. The perspective Matrix is in onResize function. I am trying to show the texture. My Render Function: GL.ClearColor(0.5f, 0.5f, 0.5f,…
Olexiy Pyvovarov
  • 870
  • 2
  • 17
  • 32
0
votes
1 answer

can i use opentk and xna in the same project and showing the data on the same window? Does OpenTk Support Xna?

there is somthing i want to draw using xna in the same window of OpenTk Project but i'm Starter in Xna so i don't know if that possible i want to draw Xna in this method if that possible: private void glControl1_Paint(object sender, PaintEventArgs…
0
votes
1 answer

How to draw near objects in first person view? (like a gun)

I have my rendering engine more or less figured out. But I need to add functionality to render a 3d object that's pinned next to the camera (like holding a gun in an fps). I tried first doing it by doing a lot of angle calculations and placing the…
elite5472
  • 2,184
  • 4
  • 21
  • 28
0
votes
0 answers

OpenGL: How to render 2 simple VAOs on Intel HD Graphics 4000 GPU?

Summary: My original question and observations are followed by an updated working OpenGL code for Intel HD Graphics 4000 GPU. Original question: Two cubes are shown on Nvidia NVS 4200m GPU and 1 cube shown on Intel HD Graphics 4000 GPU. Using…
stak
  • 129
  • 1
  • 10
0
votes
1 answer

VB .NET - failed to use OpenTk & Meshomatic - for loading and drawing a .obj file - 3D

I am trying to draw a loaded .obj file with VB .NET, but without any success. Here is my test.obj file, it's a simple cube: # test.obj # g cube v 0.0 0.0 0.0 v 0.0 0.0 1.0 v 0.0 1.0 0.0 v 0.0 1.0 1.0 v 1.0 0.0 0.0 v 1.0 0.0 …
Erwan
  • 1,055
  • 1
  • 12
  • 26
0
votes
1 answer

OpenTK Getting pixels byte array from a Bitmap

I need to port some OpenGL code to C# OpenTK. Here is the chunk where I update a mapped PBO from an array of pixels in C++ : GLubyte* ptr = (GLubyte*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); if(ptr) { …
Michael IV
  • 11,016
  • 12
  • 92
  • 223