Jump to content

  • Log In with Google      Sign In   
  • Create Account

OpenGL won't render anything


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 greenboxal   Members   -  Reputation: 113

Like
0Likes
Like

Posted 25 April 2013 - 12:34 PM

I'm writing a basic OpenGL framework in C# and I've got a problem that is holding me for 3 days.

 

I've managed to create the window, OpenGL context and all necessary things using OpenTK.

I can also clear the screen using glClear/glClearColor, but I can't render anything.

As I'm using an OpenTK assembly built with DEBUG any OpenGL error that I could get would be catch by OpenTK and a exception would be thrown but there are no errors.

 

I've working on this for 3 days and I have no clue of what is the problem. If someone need any piece of code to help me, just ask.

 

Vertex Shader:

Spoiler

 

Fragment Shader:

Spoiler

 

Test Vertices:

Spoiler

 

This would be a closed source engine but I'm pushing the code on GitHub so someone could help: https://github.com/GreenBoxDevelopment/gb3d

Some important files:

Test/SimpleTest/TestApp/TestGame.cs
Source/Engine/GreenBox3D/Graphics/*
Source/Engine/Platform/GreenBox3D.Platform.Windows/Graphics/*

 



Sponsor:

#2 Sponji   Members   -  Reputation: 1356

Like
0Likes
Like

Posted 25 April 2013 - 02:19 PM

I didn't look all of the code but have you tried changing the order of those vertices? Maybe your winding is incorrect? And I'm not sure but seems like you're using a lookat matrix for the modelviewprojection uniform, where's the projection?


Derp

#3 greenboxal   Members   -  Reputation: 113

Like
0Likes
Like

Posted 25 April 2013 - 02:25 PM

I'll take a look at the winding, about the matrix I already tried several others, including without a matrix as those vertices would work w/o one.

As I took that vertices from http://www.arcsynthesis.org/gltut/ I assume that they work


Edited by greenboxal, 25 April 2013 - 02:25 PM.


#4 powly k   Members   -  Reputation: 653

Like
0Likes
Like

Posted 25 April 2013 - 03:32 PM

Winding is probably not it - if you don't specifically enable backface culling, it's not on. What I'd try is first negative z values for the vertices and then ditching the matrix multiplication to see if the matrix is really okay.



#5 greenboxal   Members   -  Reputation: 113

Like
0Likes
Like

Posted 25 April 2013 - 03:48 PM

Tried all kind of modification on the vertices, the matrix code is supposed to be okay as it is part of OpenTK and they work there. Also tried transposing the matrix when sending it to the shaders but it didn't work.

 

 

Fixed: I forgot to set the Viewport as the default one isn't compatible with my window creation code, I'm dumb x.x


Edited by greenboxal, 25 April 2013 - 04:39 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS