forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Fri Dec 04, 2009 10:43 pm    Post subject: Why doesn't this draw a triangle? (Probably stupid mistake) Reply with quote

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:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Sat Dec 05, 2009 1:04 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
a_noob



Joined: 17 Sep 2006
Posts: 97
Location: _start: jr 0xDEADBEEF

PostPosted: Sat Dec 05, 2009 6:49 pm    Post subject: Reply with quote

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:
.øOº'ºOø.
'ºOo.oOº'
Back to top
View user's profile Send private message AIM Address MSN Messenger
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Sat Dec 05, 2009 11:17 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Sat Dec 05, 2009 11:30 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Mon Dec 07, 2009 1:30 am    Post subject: Reply with quote

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:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group