opentk

opentk pitch rotation deforms the shape

雨燕双飞 提交于 2019-12-13 21:09:18
问题 I'm using opentk in c# to render a 3d surface and rotate it. The yaw works fine, but the pitch rotation (tilting the object towards the camera) causes the surface to deform. The image on the left is what I'm rendering which is deformed and the one one the right is correct. Note that when the pitch is zero, it looks perfectly fine. Here is the gist of my code: private void glControl1_Paint(object sender, PaintEventArgs e) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask

32-bit depth buffer in OpenTK GLControl

喜你入骨 提交于 2019-12-13 06:52:25
问题 How to set a number of bits in the depth buffer of GLControl? I've tried this: GLControl glControl = new GLControl( new GraphicsMode( new ColorFormat(8,8,8,8), 32)); and it still gives 24-bit depth buffer. What am I missing? 回答1: Your GPU most likely supports 32bit depth, but not when rendering to the default framebuffer. To obtain a 32bit depth buffer you need to create and render to a framebuffer object. Refer to the following page in the OpenTK documentation: http://www.opentk.com/doc

Do the Android and iOS versions of OpenTK have the same API?

你说的曾经没有我的故事 提交于 2019-12-13 06:19:26
问题 I'm trying to get into mobile game development with Xamarin; I am using OpenTK for rendering. My plan is the following: 1. Make a shared library that is actually the game (and has all openTK code). 2. Make a a runnable project for iOS and Android that handles platform specific stuff (e.g. popping up alerts) and uses my shared library. Is this possible with openTK? Does it have exactly the same API on iOS and on Android, just the linked library is different? If yes, how to avoid code

SystemAccessViolationException in OpenTK.dll using Shaders

徘徊边缘 提交于 2019-12-13 05:37:46
问题 Using OpenTK to attempt to create shaders in C#, repeatedly getting memory access violation errors. Any help would be appreciated. Here is the class I am having errors with, full code will be able to be found at https://github.com/Autodesk/synthesis/engine-research/OpenTKBuild Error at Line 53 : An unhandled exception of type 'System.AccessViolationException' occurred in OpenTK.dll Additional information: Attempted to read or write protected memory. This is often an indication that other

OpenGL - Access RGB pixel data in a stored Texture2D

可紊 提交于 2019-12-13 05:25:30
问题 I've rendered the scene as solid colours to an FBO and stored it in a texture 2D, shown below. Now I need to access the RGB values of a particular pixel co-ordinate, or texture-co-ordinate, either is helpful. I understand I need to use GL.ReadPixels but have only succeeded creating a bitmap first and doing this every frame creates performance issues. GL.Ext.BindFramebuffer(FramebufferTarget.FramebufferExt, FBO); GL.Ext.FramebufferTexture2D(FramebufferTarget.FramebufferExt,

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

做~自己de王妃 提交于 2019-12-13 04:54:24
问题 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 OpenGL 3.2 forward profile and OpenTK to render 2 simple cubes on screen It shows the first cube centered at (0,0,0) on Intel HD Graphics 4000 with the latest GPU driver 7/2/2014 ver 10.18.0010.3621. It should show 2 cubes. We're using a Vertex Array

Simple color GLSL shader doesn't output anything

冷暖自知 提交于 2019-12-13 04:23:51
问题 I'm trying to draw a sphere with just a diffuse color, but nothing shows up. All the OpenGL code should be correct, because if I swap the "color" shader with "textured" shader, everything shows up nicely. This is the shader selection code. The if-branch is for the textured objects, and the else-branch is for color-only objects. GL.Disable(EnableCap.Blend); if (phong.diffuseTexture != 0) { texturedShader.Enable(); GL.UniformMatrix4(texturedShader.GetUniformLocation("view"), false, ref camView)

How to cut/hide projected area from bottom and top of GLControl - openTK

荒凉一梦 提交于 2019-12-13 01:18:44
问题 With the help of this link, I can project an image in cylindrical shape. Can I able to remove or hide the projected area from top and bottom of image as shown in the image below? 回答1: You have to discard fragmnts dependent on the u ( .y ) texture coordinate. According to the fragment shader of the original question How to project top and bottom area of openGL control: precision highp float; uniform sampler2D sTexture; varying vec2 vTexCoord; void main() { vec2 pos = vTexCoord.xy * 2.0 - 1.0;

Sprite/Texture Atlas: GDI+ Bitmap.MakeTransparent for color-key with OpenTK

风格不统一 提交于 2019-12-12 11:24:08
问题 I am writing a support class for sprite/texture atlas functionality, using C# with OpenTK. Most functionality is working fine thus far (simple 2D tiles on an orthographic view). My problem relates to unexpected display results when calling the GDI+ Bitmap.MakeTransparent() method to set a color (Magenta / 0xFFFF00FF) for use as a color-key. It would seem that I am using incorrect pixel format parameters for the bitmap.LockBits() and GL.TexImage2D() calls. My code was based on examples which

OpenGL with OpenTK wrapper cannot get projections to work

删除回忆录丶 提交于 2019-12-12 04:56:30
问题 I have created a simple program that creates a cube and makes its rear plane move in a circle. When i use GL.Ortho() to view it it works fine, I can see the cube but to my belief GL.Ortho() is for 2D projections and i want to make a 3D game, so I've moved on to attempting projection matrices. Heres my code so far: using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Input; using System; using System.Collections.Generic; using System.Linq; using System.Text; using