Why doesn't this draw a triangle? (Probably stupid mistake)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Why doesn't this draw a triangle? (Probably stupid mistake)

Post by jojojoris »

I am trying to do a combination between GU+Intrafont+Gamestates system dut it doesn't draw the triangle in drawtest.

http://code.google.com/p/crazyengine/source/browse/

Can someone review my code and tell me why it doesn't draw the triangle. (Probably a stupid mistake).

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

Steps to track down the error:
- does the intraFont draw/draw correctly?
- disable lighting
- disable blending (each frame, as intraFont will probably enable it again)
- disable depth testing (each frame, as intraFont will enable it each time)
- set GU_TRANSFORM_2D to check if your projection is wrong
- try to not load so many fonts statically, rather load them on-need
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

Raphael wrote: - disable blending (each frame, as intraFont will probably enable it again)
- disable depth testing (each frame, as intraFont will enable it each time)
Surely you would know this wouldn't change much, unless he is using 0 alpha without knowing, also why would intraFont enable depth testing?? Its 2D sprites last I checked. One major thing I would look at is winding order before I looked at the 2 above problems. Then I would look at the projection to insure it is onscreen, then I would look at culling, including depth and alpha testing, then blending.

Oh and Raph, welcome back long time no see. Any chance of seeing you in #psp-programming? :D

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

I checked the intraFont code and in fact it disables depth testing for it's own render then re-enables it (ie, it just assumes that depth testing was on before). I didn't find it doing that for blending though, so I guess that's pretty much out of the question, yes.

PS: Might happen I stumble upon #psp-programming once in a while :)
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

Looks like your verts are going anti-clockwise and you have GU_CW state enabled... might not be it since I don't see any backface culling going on but it's worth a shot. Lighting being enabled might be the culprit too... had problems with it in the past with it enabled and no lights on.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Thanks.

The problem was intrafont. It enables gu_depth_test and gu_texture_2D
I modified intrafont so it sets the setting back to how they were before intrafont changed them.

Code: Select all

int main&#40;&#41;&#123;
     SetupCallbacks&#40;&#41;;
     makeNiceGame&#40;&#41;;
     sceKernelExitGame&#40;&#41;;
&#125;
Post Reply