• Advertisement

Solid_Spy

Member
  • Content count

    248
  • Joined

  • Last visited

Community Reputation

708 Good

About Solid_Spy

  • Rank
    Member
  1. Really? I hear that a lot of graphics cards in the last 5 years can only hold up to 32 textures per shader execution. My card is about a year old, so I assume I cannot hold more than 32. Though I could be wrong. I'll look into that.
  2. I would love to learn how to use spherical gaussians, but unfortunately I can't find much info or any tutorials on the subject. The only info I could find were calc and theory based dissertations sadly. Do you know where I can find any practical information on the subject? Do you mean using only 9 SH textures for one texture atlas, then another 9 for another, and then combine both textures using deferred rendering? That I can do. Ah, that blows :(.
  3. Hello, I have been working on SH Irradiance map rendering, and I have been using a GLSL pixel shader to render SH irradiance to 2D irradiance maps for my static objects. I already have it working with 9 3D textures so far for the first 9 SH functions. In my GLSL shader, I have to send in 9 SH Coefficient 3D Texures that use RGBA8 as a pixel format. RGB being used for the coefficients for red, green, and blue, and the A for checking if the voxel is in use (for the 3D texture solidification shader to prevent bleeding). My problem is, I want to knock this number of textures down to something like 4 or 5. Getting even lower would be a godsend. This is because I eventually plan on adding more SH Coefficient 3D Textures for other parts of the game map (such as inside rooms, as opposed to the outside), to circumvent irradiance probe bleeding between rooms separated by walls. I don't want to reach the 32 texture limit too soon. Also, I figure that it would be a LOT faster. Is there a way I could, say, store 2 sets of SH Coefficients for 2 SH functions inside a texture with RGBA16 pixels? If so, how would I extract them from inside GLSL? Let me know if you have any suggestions ^^.
  4. Hello, I have been trying to render the HUD for my game to a separate FrameBuffer so that I can apply my own shader effects to it that are separated from the 3D scene. So far it works fine with entirely opaque objects.   The problem is that I am having transparency issues. I use glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); with glClearColor(0.0f, 0.0f, 0.0f, 0.0f);, which creates a transparent black background for the HUD FrameBuffer before rendering the HUD.   Whenever I render a transparent HUD element to the FrameBuffer, the black gets mixed in with the original colors of the element, which is not what I want. It ends up making the HUD elements look darker than they are supposed to be.   I can change the color for glClearColor() and get different colored results, so I know that that is the root of the problem. I decided to use the blend function:   glBlendFuncSeparate(/*For color*/ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,                                     /*For alpha*/ GL_ONE, GL_ONE_MINUS_SRC_ALPHA);   which was requested by someone who had a similar issue. Unfortunately it isn't working for me. I am afraid that I might need to do something involving stencil buffers and rendering the elements twice using two separate blend functions to get it to work, but I want to try to avoid that and find a simpler solution. Can anyone give me any pointers?   Here is the function I use for rendering GUI objects (some irrelevant code emitted): void RenderingEngine::RenderGuiObjects() { GuiRenderTheme* pCurGuiRenderTheme; ComponentMap* currentComponentMap = nullptr; glm::vec4* uvOffsetAndScale; glEnable(GL_DEPTH_TEST); //Prepare the gui drawing frame buffer for gui rendering. glBindFramebuffer(GL_FRAMEBUFFER, mpDrawBufferGui->GetFrameBufferObject()); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); //todo: render by layer. for(unsigned int layer = 0; layer < 8; layer++) { for(unsigned int i = 0; i < mpGuiRenderingComponents->size(); i++) { mpActiveRenObjs->pCurRenComp = mpGuiRenderingComponents->at(i); if(mpActiveRenObjs->pCurRenComp->GetPaintAlgorithmLayer() == layer) { pCurGuiRenderTheme = mpActiveRenObjs->pCurRenComp->GetGuiRenderTheme(); mpActiveRenObjs->pCurRenPosComp = mpActiveRenObjs->pCurRenComp->GetTransformComponent(); mpActiveRenObjs->curShaderProgram = mpShaderManager-> GetShaderObject(pCurGuiRenderTheme->shaderIndex); glUseProgram(mpActiveRenObjs->curShaderProgram); glBindVertexArray( *pCurGuiRenderTheme->pMesh->GetVertexArrayPtr()); uvOffsetAndScale = mpActiveRenObjs->pCurRenComp->GetPointerToUVOffsets(); SendUniform(UNIFORM_MAT4F, "worldMatrix", mpActiveRenObjs->pCurRenPosComp->GetRawPtrWorldMatrix()); SendUniform(UNIFORM_MAT4F, "viewMatrix", &mpImportantMatrices->guiViewMatrix); SendUniform(UNIFORM_MAT4F, "projectionMatrix", &mpImportantMatrices->guiProjectionMatrix); SendUniform(UNIFORM_VEC4F, "uv1OffsetAndScale", uvOffsetAndScale); SendUniform(UNIFORM_1F, "opacity", mpActiveRenObjs->pCurRenComp->GetOpacity()); SendUniform(UNIFORM_1F, "hasTransparencyTexture", 0.0f); SendUniform(UNIFORM_1I, "diffuse", 0); ChangeTextureSlot(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, pCurGuiRenderTheme->pMaterial->GetTextures()->at(0)-> textureObject); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } } } } Also this is made with OpenGL 4.2 with c++ and compiled with MinGW.
  5. "I know it will be more than one language for the different OS's."   In some cases, this is unfortunately true. If you decide to take the c++ route, you may have trouble getting a game made for the Mac, as it does not have very good c++ support (it recommends objective C with Cocoa). If you choose Java, you will have the best multi-platform support, but the language is always changing constantly, and it is very slow compared to c++.   You may not have to use different languages sometimes, but you will have to make separate builds of libraries and your program to work on different operating/game systems.   From the sound of it, it looks like your best option would be Java with LWJGL.   It's up to you. Pick your poison.
  6. .obj MESH loader

    "Im loading the U,Vs of the texture in the right way by subtracting one from it. Ive tried all kinds of different settings in blender, like vertex order and stuff with no luck   Is there a way to get the right order of uvs ?"   This is why I prefer to write my own custom 3d model file. If you are using Blender, you can write your own export script in Python, and just export the uv's alongside the vertex positions. That way everything is always in order, and then export the indices separately. You can easily read in all the vertex data via struct arrays, and then the indices via unsigned int arrays. I am personally not a big fan of the .obj file format. Your own custom format will be faster to read and parse (loading times for games are slow enough these days), and you can add/organize the vertex data any way you want.   The only advantage I see to using .obj files is that you can visualize the data, but you can also do that in Python via print(), and artists aren't going to want to open the .obj files and tweak all those numbers anyways :P.
  7. I Feel Really Stupid Now ...

    Sometimes the dumb can infect us all at the most inconvenient moments. You are not alone.
  8. OpenGL like a PRO

    To learn OpenGL like a PRO, you have to practice.. a lot. There is no simple answer. Go online and look for tutorials on how to draw a triangle on the screen, and then move on from there. There are a near infinite number of different ways to render things with OpenGL, and different programmers use different techniques. It's best to just experiment and learn as much as you can.
  9. Need help on what to do with my idea

    "And should it be an RPG game?"   That is entirely up to you. Just remember that the RPG genre is VERY saturated (almost all game genre's are saturated these days, except for collectathon 3d platformers), however if you can make your game very unique, you may have a chance at standing out. Or if you just want to make it for fun, go for it. Rpg's are also very good practice for beginners, as there aren't as many physics related problems that can get in the way.   However, you may need to do a lot of number crunching, and you have to make sure the game stays fair and keeps a steady challenge.
  10. Why didn't somebody tell me?

    A lot of std library stuff isn't as slow as people say it is, and neither are smart pointers. I use those things in my game engines all the time and they never slow things down enough, so long as you are smart with them ;). I once believed that I should avoid them at all costs.
  11. I have done it. I have officially done it!   For both static and dynamic libraries: All I had to do was replace '/usr/local/lib' with 'C:\Users\NULL\Downloads\libogg\src\.libs', and '/usr/local/includes/ogg' with 'C:\Users\NULL\Downloads\libogg\include'.   I honestly didn't think it would work, but I was lucky :P.   For anyone who was struggling with this, I will sum it up in this small tutorial :):   Step 1: Make sure you have mingw and msys installed correctly. Bash should have been installed along with msys. It should be in the bin folder. Make sure bash is in your PATH variable as well.   Step 2: Open cmd.exe, and type 'mingw-get install msys-automake'. This will install the mingw safe version of automake, which you will need to use the './configure' command to generate make files from .in files.   Step 3: Download libogg and libvorbis online. It should be easy to find. Start with libogg, and go to their main directory (using cd of course). Type bash to enable the bash UNIX shell, and then type ./configure to create the makefiles for libogg. Then, type make to create the lib files, which should be under ../src/.libs.   Step 4: Do the same for libvorbis, except type './configure --with-ogg-libraries=C:\Users\YourNameHere\Downloads\libogg\src\.libs --with-ogg-includes='C:\Users\YourNameHere\Downloads\libogg\include --disable-oggtest'.   It's a lot to type, but it should get the job done.   Step 5: Lastly, type make, and you should also have the libraries for libvorbis under ../lib/.libs.   For Static libraries only:   Step 1: Make sure you have mingw and msys installed correctly. Bash should have been installed along with msys. It should be in the bin folder. Make sure bash is in your PATH variable as well.   Step 2: Open cmd.exe, and type 'mingw-get install msys-automake'. This will install the mingw safe version of automake, which you will need to use the './configure' command to generate make files from .in files.   Step 3: Download libogg and libvorbis online. It should be easy to find. Start with libogg, and go to their main directory (using cd of course). Type bash to enable the bash UNIX shell, and then type ./configure --prefix=c:/mingw --disable-shared to create the makefiles for libogg. Then, type make, press enter, and then type make install and press enter to create the lib files, which should be under ../src/.libs.   Step 4: Do the same for libvorbis. you should also have the libraries for libvorbis under ../lib/.libs.   ----------------------------   Also, make sure the libraries are in the correct order!   vorbisenc vorbisfile vorbis ogg   Credit: https://www.allegro.cc/forums/thread/555804   Now you can use ogg files in your game for music/sound effects without paying thousands of dollars for visual studio :D!
  12. (SOLVED.) My brain has been melting trying to figure out how to get these two libraries to compile. It is ironic considering these are so incredibly popular in the game industry T_T.   I am trying to compile for windows with MinGW32, so that I can use the static libraries (.a files) for Eclipse (Oh boy, you know where this is going.).   I already have makeconf installed for msys, so that I can get the makefiles for libvorbis, however things aren't going as planned. I tried using bash and managed to successfully create the makefile for libogg, and I generated the .a file. However, when trying to do the same for libvorbis, I get the following error after typing './configure': "Configure: Error: must have ogg installed!"   I'm not sure how I am supposed to get around this. I heard that you are supposed to use ldconfig to fix the issue, but that is a linux program. I am lost here. Does anyone have a build of libvorbis.a? It might be easier to just get the library directly, but I cannot find a download.   I know that there should be hundreds of indie game developers who have used ogg's in their games. Surely someone should know what to do. Please help!   EDIT: This site helped me generate the make file: https://www.daniweb.com/programming/software-development/threads/269305/anyone-have-ever-successful-compiled-libvorbis using ./configure --with-ogg-libraries=/usr/local/lib --with-ogg-includes=/usr/local/includes/ogg --disable-oggtest   However, the makefile gives an error when using make. Fatal error: ogg/ogg.h: No such file or directory.   I even tried adding it to my PATH variables, but that didn't fix it.
  13. Success!   I found the issue. At first I thought that GL_RGBA8 and GL_RGBA32F were equivalent, for some reason :p. I changed my textures to GL_RGBA32F and now it is officially working.
  14. I decided to ditch cubemaps for now and use image2d's instead, and was suprised to see that those don't work either!!   Something is seriously wrong. I am able to get image2d to work in other compute shaders. I think the root of the problem is the SSBO, because all these problems started ever since I started using them. I think that is causing a bug, maybe in the drivers, because I am certain I am implementing them correctly. I looked at various tutorials on how to use SSBOs. However, I don't want to ditch the SSBO for storing 9 vectors, but it looks like I have no choice.   I guess I have no choice but to maybe use another texture that is write only to store the harmonic coefficients somehow.. until anyone can help me find out what the hell is going on here.
  • Advertisement