Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 2 Guests are viewing this topic.

Go Down

the-pi-guy

So apparently it didn't like the way I initialized the array of vertices.   :(

Which was not what I expected. 

There's still a mystery though.  The colors aren't acting the way anticipated. 

It seems like the buffer still isn't being loaded properly.  Because only the first 2 values of the colors of the first vertice are getting the color.  Which makes no sense to me.  I can turn it in Red or green, but I can't turn it blue, and the other 2 vertices are black. 

So far, this doesn't feel like much of a victory.  :(

But I think i'll have to finish it tomorrow.

Legend

So apparently it didn't like the way I initialized the array of vertices.   :(

Which was not what I expected.  

There's still a mystery though.  The colors aren't acting the way anticipated.  

It seems like the buffer still isn't being loaded properly.  Because only the first 2 values of the colors of the first vertice are getting the color.  Which makes no sense to me.  I can turn it in Red or green, but I can't turn it blue, and the other 2 vertices are black.  

So far, this doesn't feel like much of a victory.  :(

But I think i'll have to finish it tomorrow.
Any progress is still progress!!!

the-pi-guy

Any progress is still progress!!!

On the one hand, it'll hopefully be smooth sailing after this part.  At least some parts of it.  

On the other hand, it's frustrating that the bug was because of something so dumb.  

the-pi-guy

Sep 11, 2019, 01:28 AM Last Edit: Sep 11, 2019, 01:29 AM by the-pi-guy
How long do you expect till you get hello triangle running?
Only took me 3 weeks.   :(

So the issue was that I was using a pointer to set up my variable length arrays.  So then when I foolishly used sizeof during the call to copy the array to the buffer, it was taking the size of the pointer instead of the size of the array.  
So then there wasn't enough information for a color or vertex.

That was my stupid mistake.  

Legend

Only took me 3 weeks.   :(

So the issue was that I was using a pointer to set up my variable length arrays.  So then when I foolishly used sizeof during the call to copy the array to the buffer, it was taking the size of the pointer instead of the size of the array.  
So then there wasn't enough information for a color or vertex.

That was my stupid mistake.  
Eh that at least was a reasonable mistake. You can at least follow the logic of what you were thinking  :)

But now it works!!!

the-pi-guy

Eh that at least was a reasonable mistake. You can at least follow the logic of what you were thinking  :)
Yeah, I think I'm being a little too hard on myself.  Wasn't like I spent that much time on it.  Started back at work, and other stuff in the past 3 weeks.  

Quote
But now it works!!!
Yeah!  And a few other things should be pretty easy to add.

the-pi-guy

So I was thinking 3D, with a full controllable camera, but I think I could get away with more doing a scene like this:

Image result for super mario rpg

I think if the camera were closer, there'd be higher expectations for animations, and that's the one thing that I'm terrified to touch.

Doing this way, I think I could probably do a lot with a little basically.  

Legend

So I was thinking 3D, with a full controllable camera, but I think I could get away with more doing a scene like this:

Image result for super mario rpg

I think if the camera were closer, there'd be higher expectations for animations, and that's the one thing that I'm terrified to touch.

Doing this way, I think I could probably do a lot with a little basically.  
I think the hardest part will be setting up skinned meshes and animation systems on the programing side of things. If you're able to get that going, I think you'd be able to make serviceable animations in blender with relatively little effort.

the-pi-guy

Trying to add text has been kind of a pain. 

I'm sure there's a better library or a better explanation, but the whole process has been stitching parts together. 

This is how to create the font using sdl, this is how to turn it into a texture for opengl, this is how to display the texture.

So then when it doesn't work, it's like was it one of those 3 steps, or is there something wrong with my shaders? 

I like graphics programming, but it doesn't give error codes the way "regular" programming does.

I'd still say it's easier than debugging grammars.
 

It's been kind of fun though.  Learning more about debugging.

Legend

Sep 22, 2019, 03:09 AM Last Edit: Sep 22, 2019, 03:50 PM by Legend
Trying to add text has been kind of a pain. 

I'm sure there's a better library or a better explanation, but the whole process has been stitching parts together. 

This is how to create the font using sdl, this is how to turn it into a texture for opengl, this is how to display the texture.

So then when it doesn't work, it's like was it one of those 3 steps, or is there something wrong with my shaders? 

I like graphics programming, but it doesn't give error codes the way "regular" programming does.

I'd still say it's easier than debugging grammars.
 

It's been kind of fun though.  Learning more about debugging.
With shader debugging I always end up writing the dumbest tests to figure out what is happening. You can throw in a bunch of if statements and just see what's up.

Do you have regular textures working yet?

the-pi-guy

With shader debugging I always end up writing the dumbest tests to figure out what is happening. You can through in a bunch of if statements and just see what's up.
Yep!  That's been quite a bit of what I've been doing.  ;D
Quote
Do you have regular textures working yet?
Not yet.  I should do that first, instead of doing something else that depends on that code.  

the-pi-guy

Sep 27, 2019, 02:20 AM Last Edit: Sep 27, 2019, 02:24 AM by the-pi-guy
Haven't worked on it much this past week due to working. 

I'm not sure how it's typically done in C++.  But there is a show method in the gameobject class that our instructor gave us for our class project.  It basically draws the gameobject to the screen. 

Now I'm assuming the way to do this in c++ is to pass a pointer to the graphics code that points to the list of vertices in the gameobject class. 

I have to do some reconstruction on the graphics methods to get everything working that way, but it seems like the way to do it to match up with best practices. 

Still have to figure out textures.

I'm happy though that a month and a half after starting, I'm still excited to work on this project. 

Wish I could be doing more, but it's like at least fourth priority after work, family, house, etc. :P

Legend

Haven't worked on it much this past week due to working.  

I'm not sure how it's typically done in C++.  But there is a show method in the gameobject class that our instructor gave us for our class project.  It basically draws the gameobject to the screen.  

Now I'm assuming the way to do this in c++ is to pass a pointer to the graphics code that points to the list of vertices in the gameobject class.  

I have to do some reconstruction on the graphics methods to get everything working that way, but it seems like the way to do it to match up with best practices.  

Still have to figure out textures.

I'm happy though that a month and a half after starting, I'm still excited to work on this project.  

Wish I could be doing more, but it's like at least fourth priority after work, family, house, etc. :P
That's mostly how it works. Every object is called from the CPU to be drawn on the GPU. You can optimise this by batching objects into a single call but it's all the same concept. (not sure if this was the part you were unsure about though  :P )


It sounds like you're really close to actually making the game instead of making the tech. Lighting (can be) relatively simple and is just handled in your shaders if you want to go with forward rendering. Game graphics are pretty much just drawing triangles with textures and lighting as input. Slap a filter on afterwards and call it a day.

the-pi-guy

That's mostly how it works. Every object is called from the CPU to be drawn on the GPU. You can optimise this by batching objects into a single call but it's all the same concept. (not sure if this was the part you were unsure about though  :P )

I was unsure if that was definitely the way it was done and also unsure how it usually gets implemented.  

I can think of 3 ways to have the vertices passed onto the graphics class for drawing. Two are terrible, but I wanted to check if there were other ways to do it that I wasn't thinking of.  

the-pi-guy

I swear like 90% of the issues that I'm having with writing the program have been declaring the wrong type.  


I apparently tried passing something a double instead of a float, and it wasn't drawing, but the compiler didn't have a problem with it. So I didn't realize my error.  

Go Up