Advertisement Jump to content
  • Advertisement

Serge K

  • Content Count

  • Joined

  • Last visited

Community Reputation

154 Neutral

About Serge K

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. There is a tool called [google]... Try it, it will help you find something like this: JpegFile - free JPG (and BMP) reading and writing code [cool]
  2. Serge K

    Result of logical operations

    Fragment shader replaces all the fixed fragment processing functionality - computes colors, applies textures, etc. GLSL Tutorial - Fragment Processor GLSL - An Introduction You can use it to do the following operations: 1. fetch the source and destination texels (before that get the source and destination images to the textures with glCopyTexSubImage2D) => src, dst 2. compare the colors, output the depth value as depth = (src==dst) ? z_true : z_false; 3. ouput the source color. (if you need to xor it with the destination buffer) After that you will have the per-pixel result of comparison in the destination framebuffer's depth. To get it all fast you can use occlusion query. It allows to find out if any pixels have passed through the depth test. Basically, you start the query, draw something, then read the result - number of the pixels that passed. So, if you'll draw the rectangle with depth==z_false and the depth test set to GL_EQUAL, you'll find the number of pixels that were different.
  3. Quote:Original post by bjarniaHowever the same application on my laptop will lag to about 1 FPS (radeon 9600 mobile). Radeon 9600 has limited support for NPow2 textures - no mipmaping, must be clamped to edge...
  4. Quote:With non-uniform textures such as 256x128What kind of a beast is "Non-Uniform Textures"? Do you mean "non-power of 2"? But 256 & 128 are exactly powers 2... Do you by any chance have automatic mipmap generation enabled? It can be slow for non-power of 2 textures.
  5. Serge K

    Result of logical operations

    Quote:Original post by SmegPlaza My source pixel array is being modified by another (uncontrollable) process, and I want to know when it stops changing.Something like VNC? [smile] Ok, here is the only thing that comes to mind: 1. Grab the source & destination to the textures. 2. Draw the rect to a separate buffer. In the fragment shader compare the colors of a source and destination and use the result to output one of two depth values (true & false). 3. Start occlusion query. 4. Draw the rect with depth test enabled, depth set to separate "true" and "false". 5. Get the result of an occlusion query.
  6. Serge K

    Incredibble slow alpha blending

    Well, it's actually very common that glDrawPixels is one of the least optimized functions in a driver. Usually you may expect this one to be usable for a simple pixel transfer without blending, and that's about it. Just go with the textures & glTexSubImage2D. You better off spending some time thinking how to move those bitmap manipulations to the 3D card. [wink]
  7. Serge K

    Render to texture larger than screen?

    If you can't use FBO and pbuffer, then I guess you're stuck with glCopyTexSubImage2D.
  8. Serge K

    pBuffer Creation and weird errors.....

    Quote:error C3861: 'wglCreatePbufferARB': identifier not foundHere we go... glext.h does not provide new functions, only constants and types to declare these functions. You have to do it youself. Like this: PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC) wglGetProcAddress("wglCreatePbufferARB");
  9. Serge K

    Result of logical operations

    Quote:is there a way to detect what the result of that XOR operation is ? In other words can I tell whether the resulting pixel array is empty or not ?You can read them pixels back to main RAM and scan the array for any values !=0. Quote:Ideally, this should be a fast test.It's definitely not fast. Quote:Any suggestions you can make would be greatly appreciated.Sorry, can't help you. On the other hand, if you provide more information about what you actually want to achieve - then we may come up with some ideas... [smile] Sometimes it's better to rethink the approach instead of trying to make the bad one work.
  10. glext.h only provides the types and constants. You have to declare and initialize the function pointers yourself. PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) wglGetProcAddress( "glGenFramebuffersEXT" );
  11. Serge K

    Fullscreen Texture

    Quote:Uniforms are r/wReally? In the shaders? Since when? [rolleyes] There is no way to have global variable R/W from the shaders. It will require serious locks (critical sections) to ensure consistent state when say 64 shader units will try to access such variable simultaneously. I'm not even talking about multi-GPU configurations... btw, you may find this useful: OpenGL Shading Language (GLSL) Quick Reference Guide Quote:I have an ATI Radeon 1950 Pro, supports auto creation of mipmaps, but this is not necessary. I used it and it has huge performance faults.Actually, normally it's quite fast. That is, if the texture sizes are power of 2. On the other hand, that's how they must be for the summation trick to work.
  12. Serge K

    Fullscreen Texture

    Quote:to sum the calculated fragment in uniform variable Aren't they read only? What kind of 3D card do you have? If it can do GL_SGIS_generate_mipmaps for the FP textures, then you just need to read and scale the values from the lowest level. (In case of not 2n texture you will have to prefill outer area with 0.) Another option would be to draw this texture into FP buffer and use blending (maybe with texture filtering) to sum the values. Then read the accumulated values back into the texture and repeat this process until it all summed up.
  13. Quote:Original post by keltarSo each pixel will be 128-bit sized with RGBA. Exactly. Besides, why glDrawPixels? It's definetely not the fastest way to do it… You can draw this image using the texture prepared by ilutGLLoadImage.
  14. This function is in a debug versions of CRT libraries. _CrtDbgReport, _CrtDbgReportW You need to check if it links to a correct version and select the proper debug runtime library. Another possibility (in case if its broken only in Release mode): May be there is a _DEBUG defined where it shouldn't be.
  15. Serge K

    Loading unicode text files

    Quote:Original post by Revelation60 When I read the file in binary, the fscanf (pFile, "%f, %f, %f, %f, %f\n", &MenuPos[0], &MenuPos[1], &MenuPos[2], &MenuPos[3], &MenuPos[4]); for the first line fails. I actually don't know a way to read them in binary for I can't check for a spererator or a line end then. What can I do? Use fwscanf.
  • 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!