Questions tagged [opentk]

OpenTK is a C# library that wraps OpenGL, OpenCL and OpenAL.

Filter by
Sorted by
Tagged with
0 votes
1 answer
38 views

OpenTK and GPL license?

I want to open source my project and use a GPL license with OpenTK. Can a GPL license be used with OpenTK?
Haprintec's user avatar
1 vote
1 answer
128 views

Why are quads not rendering with OpenTK 4.7.5 when similar code works with OpenTk 3.3.3?

The following code will not render the quads with .Net 6 and OpenTK 4.7.5, but (nearly) identical code works with .Net 4.8 and OpenTK 3.3.3. (Triangles will render fine, but I would rather use quads, ...
AntiHeadshot's user avatar
0 votes
1 answer
65 views

Yaw rotation not translating to Quaternion

I'm trying to implement the gimbal lock fix described in this question, but I end up getting weird behavior where when I rotate on the X axis (or try to at least) it rotates on both the X and Y axis ...
CaptainLupa's user avatar
2 votes
1 answer
333 views

OpenTK immediate mode on net core doesn't work?

I have some old code that i imported into an OpenTK C# application running on NET 5.0. The rendering uses old fashioned immediate mode and it works on my current computer but nothing renders in the ...
Rick P's user avatar
  • 21
1 vote
0 answers
47 views

Trouble with Normal Matrix and Point Lighting

I'm having issues with lighting in my game. For some reason, no matter what I try, point lights appear to cut off halfway through the center of the light. I'm trying to render this light on a quad. ...
seesharper's user avatar
0 votes
1 answer
43 views

Corrupt Save File Problem Csharp Opentk

I am trying to save player's objects but my loaded result is corrupt and placed in weird shapes like 3D arrows. Weirdly enough when terrain is saved, the terrain is fine but objects added later cause ...
ihatemyself's user avatar
0 votes
0 answers
78 views

Why does this order of Quaternion multiplication not introduce roll into my fps-style character controller?

I'm working on an OpenGL based project (in C#), employing Quaternions to rotate my camera I first tried to: ...
Charly's user avatar
  • 742
0 votes
1 answer
214 views

C# NanoVG Transparency issue

Hi I'm trying to change from Cairo (2D Vector image library) to NanoVG. I'm using C#, openTK and Nano.VG.NET to make my game. I'm having issues with alpha? Transparency/Blending is an issue… Here ...
David Neves's user avatar
0 votes
1 answer
250 views

uniform matrix not being assigned to shader

im trying to apply a rotation matrix to my shader and when i try to set it and mult it in the shader my triangle doesn't render my drawing code: ...
vincent castro's user avatar
0 votes
1 answer
1k views

Multiple glControl on same winform is not working - OpenTK C#

I have to show frames from two cameras in two openGl control separately at same time. For that I have put two opengl control in my form and pass those frames to opengl accordingly. But when running ...
nsds's user avatar
  • 101
1 vote
1 answer
587 views

OpenGL frustum extraction

I'm trying to extract frustum planes from the camera. The algorithm is simple: create clip to world space matrix (inversed projection * inversed view) multiply clip point by clip to world matrix ...
some rand's user avatar
  • 118
0 votes
1 answer
458 views

OpenTK OpenGL wierd camera look

I am trying to implement a simple camera mouse look. ...
some rand's user avatar
  • 118
0 votes
0 answers
2k views

Greedy Meshing : Slow to rebuild when updating chunk

I've a problem with my voxel based game. The game is sliced into chunks (Like Minecraft), each chunk is 16x256x16 blocks. When I started the project, I used a basic culling system when hidden blocks ...
Sonorhio's user avatar
1 vote
1 answer
338 views

OpenGL Texture from Raw Data Not Rendering Correctly

Starting off the class in question is here: ...
Andy A's user avatar
  • 43
0 votes
1 answer
168 views

How can I load a texture from VBO?

I already have the .png file in my project, and the .png file has the "Embedded Resource" and "Do not copy" settings. The game runs fine - nothing throws an error, but the game does not show ...
Jens Eckervogt's user avatar
0 votes
1 answer
2k views

How do I enable FSAA in OpenTK?

All I could find about it is this question, but GraphicsMode alone doesn't enable anti-aliasing: ...
Dmitry Fedorkov's user avatar
-1 votes
3 answers
1k views

Multiple rendering back ends architecture

so I've been thinking about designing a rendering engine with multiple back ends in C#. Well, let me rephrase; I wish to design an engine that can be easily extended upon to support multiple back ...
user avatar
0 votes
1 answer
949 views

OpenTK Terrain - Triangle strip issue

I'm currently trying to render terrain in an OpenGL application I'm making (using OpenTK in C#). Something really odd is happening and I'm not sure why. Here is the code I use to load my terrain from ...
user avatar
0 votes
1 answer
2k views

Read from OpenGL texture to Bitmap in C#

I want to read a texture pixels from texture id (associated with some FBO) to bitmap object in opengl (opentk) in c# But it throws an exception says: ...
O-BL's user avatar
  • 103
1 vote
0 answers
452 views

OpenTK Camera Rotation issue [duplicate]

I'm currently developing a 3D game engine in C# using OpenTK. I have basic game objects, and each game object has transform (translation, rotation and scaling). A game object can have components (...
user avatar
0 votes
3 answers
413 views

The largest vector in an array

I'm working on a game engine in C# at the moment and I've come across a matter I find confusing. I need to know how to get the maximum three component vector in an array. There is a method in OpenTK ...
user avatar
0 votes
2 answers
121 views

Multiple Indices Problem

Recently, I've been trying to use COLLADA files in OpenGL. The problem that a lot of people before me have run into is COLLADA's ...
user avatar
1 vote
1 answer
649 views

OpenGL scissor odd behaviour

I am currently developing a GUI app using OpenGL with OpenTK as interface in C#. The viewport is set to the entire window space (0,0,width,height) and an ortho transformation is applied like this: <...
Raedok's user avatar
  • 21
10 votes
1 answer
10k views

Should I use retained mode or immediate mode

I'm trying to make a opengl wrapper for winforms(.net). Basically you code in gdi+ syntax but it gets rendered for opengl(using glcontrol of opentk). Which mode should I use for rendering ui? It has ...
Tushar Pandey's user avatar
1 vote
1 answer
1k views

Incomplete rendering using OpenTK (VBO)

Using Assimp.net I did load obj file. assimp returns back Mesh object that contains vertexes, normals, faces, colors and texture. when I don't use VBO the object will load complete. like this : But ...
Younes Jafari's user avatar
0 votes
2 answers
954 views

2D HUD over 3D scene

I'm trying to create a 2D Heads up Display for my players in a 3D OpenTK environment. How I'm doing it is by drawing my 3D elements and then running this code. ...
user avatar
1 vote
0 answers
94 views

Cube Translation Looks All Wrong

I'm making a very simple cube in OpenTK and it seemed to be going fine until I tried to move it around. Moving it along the X Axis seems to elongate the cube, not the result I hoped for. My Vertex ...
user avatar
1 vote
0 answers
31 views

GL.BlendFuncSeparate(ArbDrawBuffersBlend) Enum has no members?

I want to use the function GL.BlendFuncSeparate but it seems that one of the enums used has no members. public enum ArbDrawBuffersBlend { } Is ...
Daniel's user avatar
  • 11
1 vote
0 answers
1k views

Rotating an object around it's centre in OpenGL

I'm writing small 3d viewer of models from .obj file. I have a car and I want to rotate car's wheels. I found a lot of good examples but I still have a problem: wheel rotates around point at the it's ...
Nikolay Bildeyko's user avatar
6 votes
1 answer
2k views

What's the DSA version of glTexImage2D?

I want to set the initial data of a texture in an OpenGL 4.5 program (using OpenTK.Next and .NET), utilizing the new Direct State Access methods. However, I cannot find a DSA version of ...
Ray's user avatar
  • 581
1 vote
1 answer
206 views

Shader or No Shader?

I have a question about something I don't really understand. In OpenTK, should I have shaders? Is it frowned upon not to? What are the pros and cons of having shaders? Can I go perfectly fine without ...
user avatar
0 votes
1 answer
270 views

VBO Performance issues

I'm making a 2D Tile based game in OpenTK at the moment. Performance was really bad (laggy and slow) with direct drawing, so I switched to VBOs. The performance hasn't changed, it might even be slower ...
user avatar
0 votes
2 answers
1k views

How to use texelFetch

I'm trying to switch from using the GLSL texture() function in my shader to using texelFetch() because I want very little ...
BlueMonkMN's user avatar
3 votes
0 answers
606 views

Enabling OpenGL lighting seems to disable blending

I have the following code to set up for some 2D drawing using OpenTK. I originally wrote it without any lighting considerations, but later added the lighting block. This version of the code uses ...
BlueMonkMN's user avatar
0 votes
1 answer
206 views

glClearBuffer takes 1 second on a Geforce 9500GT

These 2 lines (in C# using OpenTK) seem to cause 1 second lag every frame on a machine with a Geforce 9500 GT ...
Tyron's user avatar
  • 183
0 votes
1 answer
620 views

Draw wrong faces in obj model with OpenGL VBO

I am trying to draw a 3D model from an .obj file, and have met big trouble. I think my model draws with wrong faces, but I can't understand why. Original model: This is my code for reading the ...
Aleh Lipka's user avatar
1 vote
1 answer
459 views

How to apply bindpose for vertex skinning?

I'm creating a model/animation viewer in C# using OpenTK for a game's models. Before stating my problem I want to describe a bit what I've accomplished so far in case I'm fundamentally missing ...
Greg K.'s user avatar
  • 204
3 votes
2 answers
1k views

glUniformMatrix4fv OpenTK equivalent

Very simple and quick question which surprisingly I couldn't find an answer to over the internet: what is the equivalent of glUniformMatrixfv for opentk? I've browsed all the 7 overloads of GL....
Alakanu's user avatar
  • 705
5 votes
2 answers
687 views

Trying to implement forward rendering in OpenGL

I'm working on implementing forward rendering in my 2D engine, as far as I'm aware everything should be set up correctly, I've ran into some issues earlier but I'm sure I've fixed those at this point. ...
Lym's user avatar
  • 59
2 votes
1 answer
12k views

C# OpenTK Text rendering

I've been looking everywhere for a solution on how to render/draw text for my 2D OpenTK-based game. Been trying quite a few QuickFont ones without success (either a AccessViolation exception or text ...
Ludvig Åslund's user avatar
2 votes
1 answer
972 views

Opentk hdr rendering with framebuffer white screen problem

I am trying to do hdr rendering with two shader programs: one simply draws a hdr texture on a fullscreen quad and the other one does tonemapping. I am trying either linear tonemapping ...
Alakanu's user avatar
  • 705
0 votes
2 answers
1k views

Opentk Textured Full Screen Quad

I want to display a texture on a full screen quad. What I get is a completely green quad and after a week of debugging I cannot understand why. I am currently using OpenTK 1.1.2225 and Magick.NET-Q16-...
Alakanu's user avatar
  • 705
3 votes
1 answer
527 views

Turning On/Off Vsync no longer working when rendering to an offscreen buffer

I have this reaallly strange issue that as soon as I render to an offscreen framebuffer I am no longer able to toggle VSync while my application is running. I am using OpenTK as the opengl wrapper, ...
Tyron's user avatar
  • 183
1 vote
0 answers
2k views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
Moaz Ashraf's user avatar
2 votes
0 answers
212 views

GL.Scissor not working as expected

I have some code for rendering a button in an application and I want to clip the text if it's wider than the button itself. Here a bit of code to describe what I'm doing: ...
Philippe Paré's user avatar
2 votes
1 answer
351 views

OpenTK crashes with Mono

I've implemented OpenTK as a secondary renderer which would let me support Mac/Linux only to realize that for some reason, even without any modifications (new MonoGame project), the application would ...
CoMaNdO's user avatar
  • 41
1 vote
1 answer
1k views

Applying Transformation Matrices to VBOs in OpenGL

So I've recently tried to add Vertex Buffer Object Matrix transformation to an OpenGL engine I'm working on. I could go about this by applying the matrix to a copy of each vertex individually, but ...
MathuSum Mut's user avatar
7 votes
1 answer
1k views

Dual paraboloid shadows on GLSL

I'm trying to port an XNA example to OpenTK + OpenGL, I found it here http://graphicsrunner.blogspot.com.es/2008/07/dual-paraboloid-shadow-maps.html But I'm having a really hard time, I think my maps ...
Gusman's user avatar
  • 259
0 votes
1 answer
3k views

OpenTK Ray Picking

I just can't get ray picking to work (I need to drop old working faedback mode, and replace it with color pick, but because my scene can have up to 300K+ objects it is reasonable to filter (it's a ...
dr4cul4's user avatar
  • 11
1 vote
0 answers
20 views

CanDraw in large hierarchical scene with rotation

I've been assigned to write small simulation visualization, that contains thousands of cubes (I know you heard that before). Now I'm working on optimization of stuff that takes place there, but ...
dr4cul4's user avatar
  • 11