Surprised to see this still going

Posts in this forum are most likely off topic however no porn or derogatory comments shall be posted

Re: Surprised to see this still going

Postby Badgerr » Tue Apr 30, 2013 8:44 pm

Also it might be worth profiling the use of depth testing (by giving the sprites a Z depth), and enabling alpha testing (as opposed to alpha blending, which is different) with the alpha func as equal 0. This should allow you to draw the sprites in any order. Use of depth buffer may be too hard on performance for lower end graphics, though...

edit:
thinking about it more, this is probably just as bad as using discard, as, internally, that's all alpha testing does...
Badgerr
SD Two Star
SD Two Star
 
Posts: 34
Joined: Mon Feb 25, 2008 11:38 pm

Re: Surprised to see this still going

Postby KimboSlice » Wed May 01, 2013 12:49 am

Me watching you two go back and forth -

Image
User avatar
KimboSlice
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 876
Joined: Sun Sep 14, 2008 10:41 pm

Re: Surprised to see this still going

Postby Ramy » Wed May 01, 2013 3:58 am

I haven't been reading the conversation but I did look at the glsl scripts really quickly, if you want to cut down time avoid divisions and if-else statements the if-else in shaders it will evaluate all the branches then test the condition and run the correct branch.. but since it's all done in parallel in old computers or bad gpus it will add up... shouldn't you be able to do potion by setuniformf or int w/e you want instead of doing it in the shader? and for lighting maybe vectorize whatever you're shading as objects and give them normals in the vertex shader and send those over to the fragment shader as varying var...
User avatar
Ramy
SD Four Star
SD Four Star
 
Posts: 213
Joined: Fri Feb 29, 2008 1:20 pm

Re: Surprised to see this still going

Postby Badgerr » Wed May 01, 2013 8:34 am

The special case for 1bit alpha is that you can draw with alpha testing, and not blending. But then for translucent objects (trees you're standing behind, etc), you'd need a separate queue, at which point you change the state to disable alpha testing and enable alpha blending. We use three queues like this, the third being for fully opaque objects - these are drawn before the 1bit alpha objects, but I'm not sure soma has any fully opaque objects. The result is a total of nQueues material related state changes per frame.
Badgerr
SD Two Star
SD Two Star
 
Posts: 34
Joined: Mon Feb 25, 2008 11:38 pm

Re: Surprised to see this still going

Postby Badgerr » Wed May 08, 2013 7:41 pm

After some experimenting I've found a way for you to halve the texture memory used by your sprite sheets. (assuming you haven't already done this).

(Edit: I say experimenting, most of the time was spent implementing the SPL loading/rendering for OpenGL..)

Since you're indexing a palette from a single channel texture, you can still save space by compressing it. There's a compression standard called RGTC, which includes single channel compression of 2 to 1, which you can use to compress your index texture by passing it in as GL_R8, with the internal texture format set as COMPRESSED_RED_RGTC1_EXT. I haven't tried it with all the sprites but I can't see any incorrect indexing from compression loss in the ones I have tried. From what I've implemented, it looks pretty identical to a GL_R8 texture except that it's half the memory.

(Edit: I take it back, I found a lossy one... never mind. Good thing this is the worthless spam section :P)


Also, about your stuttering problem when uploading a texture, a simple solution is to glTexSubImage2D parts of it one frame at a time. It keeps the render loop responsive, and you can add a check somewhere so you don't start rendering it until it's all there. Keep in mind if you use a compressed texture format you need to subimage in 4x4 aligned blocks.

Next on my list is cutting all the wasted space out of each sprite frame, I expect that to be somewhere in the area of a 60% saving on texture memory
Badgerr
SD Two Star
SD Two Star
 
Posts: 34
Joined: Mon Feb 25, 2008 11:38 pm

Re: Surprised to see this still going

Postby cappilio » Mon May 13, 2013 8:35 am

Nice to see old faces popping in, i always keep a ninja eye on this place:)
Image
User avatar
cappilio
SD Pro 5 Star
SD Pro 5 Star
 
Posts: 769
Joined: Fri Jul 17, 2009 7:29 pm
Location: United Kingdom; East Midlands; Derby; Sinfin

Previous

Return to Worthless Spam

Who is online

Users browsing this forum: No registered users and 5 guests

cron