Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

212 Neutral

About stanlo

  • Rank
  1. stanlo

    Rend to transparent surface

    How are you drawing it exactly? If you drew whatever you're drawing to the back buffer, does it look correct? Are all your render states correct?
  2. stanlo

    [XNA] Brighness?

    What's so bad about HLSL? It was made so that you have all the flexability you need rather than limiting yourself to a couple premade functions and parameters.
  3. double post [Edited by - stanlo on April 24, 2007 7:56:36 PM]
  4. Edited into OP [Edited by - stanlo on April 24, 2007 7:55:54 PM]
  5. If you take RenderScenePS in the sample it compiles to six instructions, but it should be able to compile to only one or two depending on useTexture. Does it actually compile to the correct number (one or two), or does it do six despite the parameters always being the same for a technique?
  6. I'm having trouble with my pixel shader unnecessarily compiling extra assembly instructions. An example of what I'm trying to do: I'd like one technique that uses a texture and one that doesn't, and have a "useTexture" boolean parameter. I would have on pixel shader function that's specified in two different techniques with different parameters. Inside the pixel shader is an if statement that's something like: if (useTexture) color *= tex2D(sampler, texCoord); and the technique declaration looks like: PixelShader = compile ps_2_0 Foo(true/false); Now maybe I don't understand shader compilation very well, but it seems that it should be able to predict away the if statement. If useTexture is a constant it works fine, but if it's a uniform parameter it becomes needlessly longer. It's defined in the technique so it won't ever change right? I tested this in NVShaderPerf. I couldn't figure out how to make fxc.exe let me specify the parameters I was passing into the function. I know uniform sounds like "constant for a draw call" rather than "constant forever", but there should be a way to do this easily right? I want to specify how a pixel shader function works in a technique, and I want it to be fast. edit: Ok, I guess it is optimized out like I thought it should be. I was worried that I was compiling conditionals in since I wasn't looking at the right assembly. I should have passed /T:fx_#_# instead of /T:ps_#_#. I sure feel silly now! Sorry for the waste of a thread. [Edited by - stanlo on April 24, 2007 6:02:29 PM]
  7. Quote:Original post by AndyTX That's the only thing that I do somewhat differently when targeting 8000 series hardware, and it's fairly minor in most cases (the exception being when a vector processor would require a non-trivial data rotation to perform efficiently, while on the G80 that would just waste time). That's really interesting, do you know why this was done? Optimizing towards vector processors sometimes makes things look silly, but I assumed that it was just "the fast way" to do things in GPU land. Was there some sort of development that sped up scalar processors to the point that vector operations on each processor type were the same speed?
  8. I think 0 means save state, as there's special flags for not saving state. In Xna this is reversed and state is not saved by default.
  9. The number of SPUs on a card doesn't really affect anything except performance as far as I know. What matters is the shader version number. Version 1 vertex shaders, for example, are not guaranteed to have as many available constant registers as Version 2 (or 3 or 4). The only way to make flexible shaders that I know of is to just write multiple functions that target different shader models, and select them at runtime based on the card capabilities. All the 8 series GeForce cards should support VS/PS4. You still need to consider performance though. A shader that runs fast on the high end 8 series may not on the low end.
  10. stanlo


    Quote:Original post by nixon - With nothing on screen: 215fps - render a 286x400px texture in full size with a vertex buffer: 191fps - draw a grid 400 vertices and a LineList: 118fps - both: 111fps This makes sense. 1/(1/191 + 1/118 - 1/215) ~= 111 The fishy part is only getting 215fps with absolutely nothing on the screen. Do you have a slow video card? Try using PIX or NVPerfHUD. They'll tell you how long everything you draw actually takes. You can't time the length of a draw call on the CPU since the CPU isn't the one doing the work.
  11. It looks like you don't have depth testing enabled. Try setting the ZEnable render state to true. Don't forget to clear your depth buffer too.
  12. stanlo

    basic questions

    To move an object in the world, you want to move the world and draw your object. In general, you want to touch your vertex buffer data as little as possible. Using a graphics stream allows a more general way of writing to the buffer by letting the vertex buffer work with things that take an abstract Stream object. You probably want to use SetData, as it's pretty easy to use and is really just combining a lock, write, and unlock for you. How handy!
  13. Yea the viewport was the first thing I thought of and wasn't the issue. It worked fine with smaller textures. I kind of assumed my friend had a separate depth buffer for the render target but that wasn't the case. I'm pretty sure it will work once he sets that up.
  14. That's a good point! I didn't think that he might just be using the back buffer's z buffer. I kind of thought your back buffer was required to be the same size as your render target or it would crash or something silly like that.
  15. stanlo

    Water (fresnel) tutorial/primer

    fresnel is what you use to compute the ratio of reflection/transmission of light. When light hits a surface, how much goes through the surface and how much reflects? Normally none goes through opaque objects (in 3D graphics land, not in the real world), so you don't care about fresnel or transmission at all. The actual computation of fresnel inovlves a bunch of silly math that isn't necessary at all to get a decent result. I liked the NVidia SDK demo of Vertex Texture Fetch Water. It comes with a white paper and a demo, as well as a quick explanation of fresnel and how you can fake it easily.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!