# Halo Vortex

Member

111

134 Neutral

• Rank
Member
1. ## Quadratic optimization problem-need help

Unfortunately, A isn't positive - it's a general matrix. I understand how the search volume looks like, but since A isn't positive, constructing it and walking along it will give no result. I guess what I need is a nice iterative method. Pretty much like Simplex, but that will work with Dot(L, AL) and support simple boundary constrains for all variables.
2. ## Quadratic optimization problem-need help

After applying Lagrange-constraints to my problem, I get the following task: I have to maximize: F(L)=Sum(for each i,j=1..N) Li*Lj*A[i,j] -simple quadratic polynom Where A is a known matrix of something like 10k x 10k elements (still enough to fit in memory as a whole object) Maximization is performed with L=(L1,L2,...,Ln) using the following constraints: 0<=Li<=Const1 Sum of BiLi=0 (Bi - known koefs) Sum of Li=Const2 So if there weren't any constaints, I would have just used gradient opimization. But I don't know what to do with constraints, especially the 0<=Li<=Const one Also, it sure doesn't have to be realtime, but still it would be nice if solution is found in a reasonable time (5-10 secs for 10k elements for example). I faced this problem while trying to implement Support Vector Machine data-classification method. Any help or links would be appreciated

As I've started using more effects in my engine one unified vertex shader for skinning is not enough any more. The problem is that for skin shader, a lot of parameters need to be send with glProgramLocal... So can somone explain what happends if you bind another program? Are the local parameters stored for that program somewhere so if i bind it back, they are still there or they are invalidated? And if second, are there any sort of global parameters that exist between different vertex/fragment programs and if so, how can they be accessed from vertex program (ARB_VERTEX_PROGRAM)?
4. ## Doing light shafts?

I've watched several demoscenes lately and wondered how they do lightshafts in it. What I mean is that in those demos there's a very powerful light and some 3d geometry or clouds obscuring it, only that you're looking directly at those clouds and volumetric seamless light shafts stream through holes in those obstacles. I can think about extruding something like 'shadow volumes' for geometry, but how do they do that for arbitary textures-alpha masks?
5. ## Skinning and performance. Help!

Thanks. Still I don't understand why fps drops so much only because unsgined_int is used instead of unsigned_short. It's not a bandwidth question, since changing from short int to int makes index data only twice as big and performance drops 5-10 times at least
6. ## Skinning and performance. Help!

I've finaly fixed the problem! Although it seems a bit weird, changing type of indexes from int to short made fps rise 10 times! Another strange thing is that if i use int or unsigned int for index array and then declare GL_INT in glDrawElements, nothing is drawn in both cases, but everything is rendered when I use GL_UNSIGNED_INT (Why int * buf, GL_INT doesn't work, but int * buf, GL_UNSIGNED_INT does?).
7. ## Directional light in per pixel lighting

You pass it the same way you pass omni-light. Only instead of light's position you pass direction. (As parameters(local or env) to a vertex program). Now throw away your lightdir=vertexpos-lightpos and transform your direction vector with TBN matrix instead
8. ## Skinning and performance. Help!

Damn, my inet balance has nearly run out, so I will upload exe so that somebody could test it on their machines in a couple of days once I pay the bills. I will try formating Vertex to 64 bytes and use GL_SHORT for indexes. Maybe it will help. Also, will check if vertexes are uploaded more or less sequentially so they are cache-friendly(or at least seek-transfer friendly) Thanks for helping with it. I was going to just adandon this and use a low-res model but when I heared that people actually do achieve "100.000 triangles, and skin it on GPU with 3 directional lights at about 380 fps", I want to finish this. Also, can anyone tell what fps in 3DMarks03, 05 do you get in Vertex Shader tests? Maybe my video card isn't tuned or something.
9. ## Skinning and performance. Help!

Changing matrix's indexes in Vertex's struct from float to short didn't change anything (60bytes to 56 bytes stripsize) and vertex's structure can't be reduced anymore. Yes, I use interleaved data, Floats for everything. Indexes of vertices are also in another VBO. Ints. (Can't make them shorts as VBO is more than sizeof(Vertex)*65536, plus it won't change much - Disabling Vertex Program caused fps to go sky-high so it's not a transfere bottleneck) No fragment program is used for this test. Nope, I don't update data - it just lays there in VBOs Only thing I update is those bones' matrices, but that isn't a problem Yep, I've already read this pdf and I follow advices there (will have to check glDrawElementsRange, but since my VBO is only a bit bigger than it won't change the situation. So I just don't know why it's so slow. Maybe because I wanted to learn CG a bit and used it for skinning. But then again I used GLintercept and generated program is 26-27 instructions long, so it's not optimal (I used both VP40 and ARBVP1 profiles and nothing changed) I'm beggining to think that GeForce6800 just can't process so many vertexes.
10. ## Skinning and performance. Help!

Switching off vertex program caused fps to go to 60fps mark(vsync-limited probably, although I switched Vsync off,... strange). So it's vertex program after all. And since reducing instruction count doesn't help much, it's probably because aprox. 88 params are used(skinning matrixes + some minor stuff). Does it make VP run slower if it references a lot of params (still withing 92 ARB standart minimum)
11. ## Skinning and performance. Help!

To: the_cyberlord I've recently read about ATI's ruby demo and watched nVidia's Dawn where main characters had 75000 and 180000(at ultra quality?) polys skinned and animated with 4 weights. So I wanted to test hardware skinning with at least half as much polys. I've downloaded NVperfHud, but it's for DirectX and I use OpenGL. Is there anything similar for OpenGL? It's probably data transfere bottleneck after all. Decreasing vertex shader's complexity from 20 to 10 instructions didn't make it run faster (although after around 50-60 instructions, vertex programs processing bottleneck appears) But i don't know why - for this test i created the only VOB with 7Mb and 1Mb for indexes (and with STATIC advice so it's very likely to be placed in Video-mem. BTW, is it possible to check it?). Each vertex is only 60bytes. Plus I use glDrawElements, so polys are indexed. What can be done to get rid of transfer bottleneck? If I change indexes from float to byte, program tends to be running slower(seems like byte isn't a native format and card spends some time converting it)
12. ## Skinning and performance. Help!

I've just made hardware skinning in my engine and tried to animate 45000 polys model. To make a test, I also switched on cube-map shadows and as a result there're about 350000 polys each frame (Around 200000 different vertexes, although i'm not sure they're placed in a cache-friendly way) But the result disapointed me: although skinning was performed only with 2 matrixes (21 instructions with 6 address-modified e.g. DP3 c[A0.x], vec), it showed around 10-12 fps on my GeForce 6800 (not GT or Ultra), which means that only around 3.5-4 million vertexes per second, and I still haven't applied lighting - just positions and normals. Shouldn't Even 'lesser' GeForce 6800 show higher performance. (In presentation nVidia tells that Ultra processes 30millions of vertexes with 1 tex instruction(around 20 cycles latency, the same as my program) I guess bottleneck is in vertex-program(Not pixel-shading, fillrate or cpu problem). I also checked with GLintersept and there aren't a lot of calls, but when increasing vertex program's size, fps drops(Although not even close to linear: increasing num of instructions 3 times lead to 1.7 fps drop)
13. ## Vertex/Fragment programs question

I meant when you use glProgramLocalParameter4fARB. (Sure inside temporary registers for every vertex can't be cached and there's no reason to do it really, at least all of the information). But why than function has Local in it's name. Should I use glProgramEnvParameter instead? and refer to it through .env[] inside my program? And BTW, what about CG? How can I pass "enviromental" parameters there that aren't changed from shader to shader one time so that they can be used by many programs without resending them?
14. ## Vertex/Fragment programs question

Does somebody know what happends when parameters are sent to a vertex/fragment program. () Are they set globaly(inside gpu) and when you change a program, they will be accesible from the new program if now overwritten or are they set to exactly this vertex program and when we change it, they will be kept inside that program's descriptor so switching back will cause them to return or will they just be invalidated. I ask this because when doing program skinning, you have to send a lot of matrixes to the vertex program and i have several of similar ones for one character and right now i send matrixes for every vertex program (). So can this be optimised?
15. ## Per pixel lighting and object space. Need help

I've searched through gamedev but couldn't find an answer to my question. Say you have lightpos, vertex's position, normal, tangents e.t.c. When using lighting equations with (lightpos-vertex's pos) dot normal e.t.c. everything is ok as long as lightpos and vertex's attributes are in one space. When object is transformed by a simple(rotation+scaling+transformation) matrix, one solution is to multiply all vertex's attributes by this matrix in a vertex shader (Is it correct for normals? )and use ordinary lightpos. But this is slow. Instead, it's better to transform lighpos in object's space, but HOW? Is it just enough to generate inverse of object's matrix and transform lightpos with it and leave vertex's attributes as they are, without transforming them? (sure they'll be transformed to screen space later anyway). If so, how does distance between lightpos and vertex's pos change? Does it stay the same or do you have to multiply(divide it) by matrix's determinant or something like that?