Advertising (This ad goes away for registered users. You can Login or Register)

I need help finding a bug in my application

Open discussions on programming specifically for the PS Vita.
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
FirebirdTA01
Posts: 6
Joined: Thu Sep 15, 2016 5:57 am

I need help finding a bug in my application

Post by FirebirdTA01 » Thu Sep 15, 2016 9:21 am

Hi everybody, I'm trying to write a simple 3D sample program for the vitasdk in c++. It has a huge focus on being object oriented and is set up in a way that it may be able to be expanded and compiled as a library in the future. Everything compiles okay, but it doesn't run as expected. All I'm trying to do with it is render a simple triangle primitive using a properly set up gxm (i.e. triple buffering, use of the gxm_context, render_target, sync_objects etc) and simple passthrough shaders.

The problem: The triangle is drawn and rotates on screen, but the 3rd vertex, the last one declared, is drawn so far out of range that the RGB triangle looks more like an RG rectangle.

EDIT: I no longer think the wvpData[] is the problem, as changing the color of the first vertice to blue breaks the program.... It's got to be a memory size/alignment/allocation issue, or shader program creation issue... or something. I'm grasping at straws here! lol

I've been working on this for a few days now, and unfortunately I don't have very much time to allocate to it. I have the code posted on git and I would appreciate some outside knowledge from some nice people that may be willing to help. My goal for this is to get it working, then it could be stripped down (i.e. the logger class) to be simple enough to use as a sample for people in the open source vitasdk. There aren't many cpp samples and there aren't any 3D samples, let alone anything that fully sets up the gxm and shader patcher.

After its working, one branch could be stripped down to become a vitasdk sample, and the master could be expanded into a sample framework for building object oriented projects for the vita without having to link to any other libraries such as libvita2d.

I don't claim to be a master programmer, which is why I'm here asking for help, but I would like to be able to contribute and help others to the best of my ability. If you look at the code, please come back with constructive criticism and not just slander and insults. We all do this for free.

Heres a link to my git repo:
https://github.com/FirebirdTA01/Vita3D_Sample_cpp

Thanks for taking the time to read and especially thanks to anyone who can offer help or shed light on what the problem may be.

EDIT: I should refrain from using the word 'simple' when talking about this program... The framework is not simple, the task its being used to accomplish is. The reason for the complexity is that I want its USAGE to be simple. I mean that I'm trying to get Graphics:: to handle most of everything in the background, auto-magically. lol
I think the problem, again, is in either the wvpParam or wvpData in the Triangle class. I'm not good with 3D programming, so my math may be flawed or something.... I'm not sure
Thanks again!
Advertising
Last edited by FirebirdTA01 on Fri Sep 16, 2016 11:48 am, edited 1 time in total.

FirebirdTA01
Posts: 6
Joined: Thu Sep 15, 2016 5:57 am

Re: I need help finding a bug in my application

Post by FirebirdTA01 » Fri Sep 16, 2016 10:22 am

UPDATE:
Changing the color value of the first vertex in Triangle::init() from red to blue makes nothing be drawn on screen, changing the x, y, z or color values of the 3rd vertex does nothing. I've looked at variable types making sure that everything is declared correctly... I had my BasicVertex typdef struct's color value as a uint32_t instead of unsigned int, which I thought may have been the problem as well as passing SceSize instead of unsigned int to the memory allocation functions, but none of these made any changes in the programs execution. I'm still at a loss
Advertising

gunblade
Posts: 52
Joined: Tue Aug 07, 2012 12:16 pm

Re: I need help finding a bug in my application

Post by gunblade » Fri Sep 16, 2016 10:29 am

this sounds so cool.

FirebirdTA01
Posts: 6
Joined: Thu Sep 15, 2016 5:57 am

Re: I need help finding a bug in my application

Post by FirebirdTA01 » Sat Sep 17, 2016 5:40 pm

Alright, thanks to kozarovv from psx-place the problem has been rectified. Thanks anyway for checking it out. I will continue development and keep the git repo up to date

Post Reply

Return to “Programming and Security”