• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

136 Neutral

About funkeejeffounet

  • Rank
  1. Hi all, I have a polygon which is associated to a height map, and I would like to compute the normal vectors of the polygons' pixels relatively to the height map. Does anyone know the formula for achieving this ? I believe that once found, applying the ModelView matrix to these vectors work. Cheers, Jeff.
  2. Does someone plan to simulate Fluid on 3D

    Hi, Choosing a fluid simulation scheme greatly depends on your type of fluid : - Do you need to track the free surface of the flow (as for a liquid and as opposite to a gaz) - Is it a multi-phase simulation and can there be great differences in viscosities or densities between the fluids - How do you plan to render the scene (is it for real-time, offline rendering etc.) But basically I would say that today's reasearch in the area focuses on grid simulations with level sets (which is a signed distance field). You could also use the simple MAC grid for its simplicity. Revelant articles in this scope would be in my opinion : - Nick Foster and Dimitri Metaxas, Realistic Animation of Liquids (extended), Graphical Models and Image Processing, 58(5), (1996), pp. 471-483. - Jos Stam, "Stable Fluids", In SIGGRAPH 99 Conference Proceedings, Annual Conference Series, August 1999, 121-128. - Douglas Enright, Stephen R. Marschner, Ronald Fedkiw: Animation and rendering of complex water surfaces. SIGGRAPH 2002: 736-744. Mark Harris' article on GPU Gems2 is a good way to start, even though only gaz is simulated. Hope this helps, Jeff.
  3. Hi all, I was wondering if the refract instruction in GLSL-Cg is accurate from a physical point of view. I mean that, is the vectorial approach used to compute the refraction vector in GLSL-Cg gives the same result as if we applied the law of Snell-Descartes in Physics ? If it is an approximation, does someone know its quality ? Cheers, Jeff.
  4. Texture Access in Vertex Shaders

    Ok thanks guys, I've checked the paper and I also learned that linear filtering isn't supported (and I need it in fact). Also, only 2D textures are supported in OpenGL... I've disassembled my code with NvShaderPerf and there is something bugging me : In fact with 128 iterations in my fragment shader, I only have 900 instructions. The limit being 65535 instructions, I don't understand why my code fails (in terms of execution, not compilation) with 256 or even 1024 iterations. Even disassembling the shader with more thant 128 iterations fails... Someone had any GLSL / Driver77.77 issues? Thanks, Jeff.
  5. Texture Access in Vertex Shaders

    I got a GeForce6600 so I have the PS3.0 Model (Driver 77.77). My texture is GL_RGBA8 of unsigned byte with 256 texels, so you think I only can use Floating Points formats in a vertex shader? Do you think I can pass to the vertex shader uniform array of 256 vec4 elements? It seems rather big... Anyone can confirm if standard RGBA textures accesses are supported in vertex shaders?
  6. Hi, I'm using in my fragment shader a loop to compute a certain numerical value. However, the quality of the result depends on the number of iterations that has been done. Due to the fact that loops are unrolled in fragment shaders, I am limited in term of iterations so I thought about doing the computation in the vertex shader(branching is possible, so no unrolling is needed) and the result will be passed as a varying variable to the fragment shader. The problem is that my vertex shader compiles and links fine, but the result is rubish. I am sure that my algorithm functions well (it has been tested over and over), so I was wondering if the texture access that is used in the loop (1D Texture) wasn't faulty here. Has anyone had any issues while accessing textures in a vertex shader? I would appreciate some help, Thanks in advance. Jeff.
  7. Number of GPU cycles for cos and sin functions?

    I had exactly the same reaction that the_phantom. When searching on the net about the cost of trigonometric functions on GPUs, you can only find articles related to ATI's newest graphic cards. On the nvidia site, you cannot find anything about such things, so if they don't brag about it, it seems pretty obvious that they do not support such functions in hardware... Anyway, in their GPU programming guide, it is said that we should prefer the built in functions for simple instructions(log, exp...) to a precaculated table(texture). I've tested both approaches, and a precalculated texture isn't worth bothering(even for atan...), so I guess that if they do not support it in hardware, these functions are still fast. Guess Nvidia will have these built in in hardware for their next NV5x. Cheers, Jeff. PS: How come there isn't any docs on the instructions' cycles if you wanna do assembly for GPU? How can you optimize then?
  8. Hello, I was wondering where I could find some GPU's documentations regarding the instructions' cycles, as we commonly see for any other processors? I am especially interested in the number of cycles of the cos and sin instructions on the latest Nvidia's hardware(GF6x00), could anyone help me on that please? Are they implemented in hardware? Thanks in advance, Cheers, Jeff.
  9. OpenGL Normalised texture coordinates to texels

    Oh thanks a lot for this hplus0603. Just one thing about 4). Don't you mean interpolation between the first texel and the border's color for GL_CLAMP_TO_BORDER in the case a border is defined? Doesn't GL_CLAMP keeps the last texel(as texture coordinates ara clamped to [0,1]? Like if the value of the first texel(0,0) is (1.0,0.0,0.0) and if we specify the texels coordinate (-2,0), then the value we get will be (1.0,0.0,0.0)? I don't see the difference between GL_CLAMP and GL_CLAMP_TO_EDGE but maybe there is one :) Anybody knows? Last thing, I've looked at the spec but cannot find the pages where they explain the GL_NEAREST and GL_LINEAR stuff(must be kind of blind I guess...).Could you please point me out to them. Also, is it possible to use integer texture coordinates(like array indexes) in shaders? Cheers, Jeff.
  10. OpenGL Normalised texture coordinates to texels

    Well I've browsed the spec and couldn't find a clear answer about that. I just need the math behind GL_NEAREST and GL_LINEAR, really weird I cannot find this by googling... Anyway, about the integer coordinates I didn't know that. Does this mean I can address the texels like as if they were an array? If so how(I'm using shaders maybe it is different)? Cheers, Jeff.
  11. Hi, I've been wondering what were the math in the OpenGL API for passing from nomalised textures coordinates to texels(integers coordinates)? Like for a 2D texture of 256*64 and the texel u,v=(0.2,0.7), what are the texel coordinates(like a 2D array in C beginning from 0)? u = 0.2 * 256 = floor(51.2) = 51? I really need to get this accurately because precision is very important in my current project, I cannot afford fetching a neighbooring texel. Thanks in advance, Jeff.
  12. Floating point textures

    Hi, Well maybe you should upgrade your drivers to support the GL_ARB_texture_float extension(even to beta ones, they are precious ones for developpment). Anyway, if you don't, even NVidia prefer the GL_ATI_texture_float to the NV format, all the descriptions(internal format, clamping) are on: http://oss.sgi.com/projects/ogl-sample/registry/index.html Generally no clamping is enabled, but if it is, you can disable clamping with the GL_ARB_color_buffer_float extension (http://oss.sgi.com/projects/ogl-sample/registry/ARB/color_buffer_float.txt). Finally to test if your card support a texture you defined(size, format ...), use the PROXY stuff in glTexParameter and check the output. Hope this helps, Jeff.
  13. Longest vector in a torus...

    There is a misunderstanding. I'm talking about the PARAMETERICAL equation of the Torus, that is why I have 2sqrt(Rr)[forgot the sqrt before, sorry). Isn't that correct then?
  14. Longest vector in a torus...

    Yes it is, I found 4*r*R(using pythagore). No it is not homework, it is for a volume rendering technique(I'm old enough for not having homework...). Cheers, Jeff.
  15. Longest vector in a torus...

    Hi, Given the parametrical of a torus : x = (R + r*cos(theta))*cos(phi) y = r*sin(theta) z = (R + r*cos(theta))*sin(phi) and knowing r and R for our current torus, I was wondering how can I find the longest vector that this torus can contain in its volume? The 2D case (view from up) is easy but I cannot figure it out in 3D. Anyone can help here please? Cheers, Jeff.
  • Advertisement