HippyNerd

Members
  • Content count

    17
  • Joined

  • Last visited

Community Reputation

122 Neutral

About HippyNerd

  • Rank
    Member
  1. Hey Guys, I've been porting my code from GLSL to CG. I'm wondering if there is straight forward support for user clip planes within Cg. I.e I know if I use the arbvp1 profile I can access clip planes, using something along the lines of glState.clip[x]. However I'll probably be using vp20 profile etc. I can pass the clip planes in as uniforms perform some dot products etc, but I'm sure there must be an easier way. (I've found googling for "Cg" a lot less effective than "GLSL". Since most hits turn up the CG tutorial book released by nvidia, or other sites related to the usual "cg" term.) thanks
  2. Packing a float into a texture

    Ok that's good to hear. I was just about to start benchmarking the differences in the two approaches. I've got butza's methods implemented, but I'll also go for floating textures now. Its for a uni project so no harm done in having learnt the alternate way of doing this as well. Thanks for all the really helpful info guys.
  3. Packing a float into a texture

    Thanks heaps Buttza, i'm implementing a method simmilar to your idea now. I hadn't really thought about separating out the fractional part like you have. This is cool.
  4. Packing a float into a texture

    It looks like extensiosn such as ATI_TEXTURE_FLOAT allow 32 bit values to be stored in textures, without being clamped. Not sure how to access these from the other end via GLSL though. Working on that now...
  5. Packing a float into a texture

    Well that's exactly what I'd like. So far I havn't been able to find anything in the specs though :-/
  6. I know there are probably a couple of ways to do this. But is there a stardard way people use to pack a floating point into a texture. I would like to extract it as a float in a fragment shader. If its a 32 bit int I can cleanly take 8 bits and store them in the RGBA channel, then in my fragment shader do something like vec4 texVal = glTexture1d(tex,value.u); float number = dot(texVal,vec4(1,256,2^16,2^24) (except I'll also have to account for normalisation of the texture values to [-1,1]..gah) Just wondering if there was a way of doing this with a float, or even if I can use some other channel (such as a depth texture). To store the values. (I know above if I can figure out how to pack an int, I can convert my float to an int in the main application and convert it back in the frag shader...however all these conversions will start slowing things down) Thanks,
  7. Accessing texture in vertex shader

    cool thanks oh well back to trying to access values in uniform arrays using a non-constant index...gaaaah why so slow
  8. In GLSL, on a card with PS2.0 support only (x800xt). Is it possible to access a texture value from a vertex shader? (as opposed to a fragment shader). (Under GLSL in particular). I get linking errors when I attempt this. I guess usually you don't need texture values in the vertex shader. I was just hoping I use a texture as a lookup table to store some values :-/
  9. Is it just me, or is accessing an array with a non-constant value in GLSL extremely slow. float testArray[10]; int index = 8; float blah = testArray[index]; This brings my framerate down to about 0.5 FPS (on a x800xt pe) Equivelent code runs at a fine speed in Cg. (And I assumed the code would get compiled to very simmilar assembly anyway) Any ideas? thanks,
  10. Ok just realised I must be having major issues if I'm getting half the frame rate, with the same video card, and a 2.8 vs .85ghz processor. How do you find out what winXP GL drivers you have?
  11. Could you please try this demo and comment about the frame rate you're getting? Demo binaries. I get 103FPS on my x800xt platnum (p4 2.8, 1gig ram) I get around 60FPS on my 9600 mobility pro. (pentum M 1.6, 1 gig ram)
  12. Ok that makes sense. Thanks for the shader code. Wouldn't have figured that out by myself :) Intergrating it now.. Glad I don't have to learn pbuffers. Was reading an nvidia presentation about framebuffer objects...those are still in beta but looks like ATI is lagging behind a few months still?
  13. i would be quite interested in seeing that code. Although I'm not all that proficient with GLSL so it might take a bit of understanding. My email is ahar083 'at' cse.unsw.edu.au So basically I can't render directly to a depth buffer? If I'm implementing shadow mapping then I will definantly need to render to a pbuffer I suppose? I'm new to playing with buffers so this is all a little confusing to me. thanks
  14. I was using glPolygonOffset. However I've now commented references to that function out, and there actually wasn't too much of a speed dif. Darn didn't want to have to learn how to utilise pbuffers yet..
  15. Hey Guys, I have a pretty simple piece of code (shadow mapping...but I can reduce it to just calling the function glCopyTexSubImage2D) When I call this function, frame rates drop from 800FPS to 5FPS. (On my P4, with ATI x800xt. Catalyst 5.4 drivers) Exactly the same piece of code when compiled on my laptop, with a radeon mobility 9600 runs at a fine framerate (~250). Any ideas?