Jossos

Members
  • Content count

    89
  • Joined

  • Last visited

Community Reputation

343 Neutral

About Jossos

  • Rank
    Member
  1. I'm making a 3D RTS, and I want to see if a tile is in the window or not. I have been told to multiply the MVP matrix by the vector position (im using the center position) of the tiles, and I am to somehow get some value between -1 and 1 to see if it is in view.   I am confused how I get a value like this from a vec4. Also when I multiply by the position, do I just put 0.0 for the w component?   My view frustum is extremely simple. The tiles will always be within the near and far planes, it's always guaranteed a single tile will not fill the screen etc. I'm looking for fast, but asking people and searching google has not yielded a demonstration of the vec4*mat4 approach.   Help is appreciated/
  2.   I think so. I have refraction/reflection textures rendered at 1/4 of the screen resolution, as well as the depth. I then render full screen at full resolution, comparing gl_fragcoords.z with the depth texture (which is at 1/4 resolution)
  3. I'm following a tutorial, trying to blur the edges of water, but I'm getting weird jaggies which I just can't seem to get rid of:     This is caused by the depth texture ("depthMap") having a lower resolution than the screen, which I want for optimization. Here is the shader: http://pastebin.com/QfZHBttT   Noteable parts: float depth = texture2D(depthMap, refractUV).r; float floorDistance = 2.0 * near * far / (far + near - (2.0 * depth - 1.0) * (far - near)); if (depth >= 1.0) discard; // This never works depth = gl_FragCoord.z; float waterDistance = 2.0 * near * far / (far + near - (2.0 * depth - 1.0) * (far - near)); float waterDepth = floorDistance - waterDistance; FragColor.r = waterDepth; // using this to show what's going on. I am not sure how to fix this. I just need those edge pixels to be invisible. They appear at any time the resolution of the depth texture is lower than the screen.   Any help is appreciated.
  4. why does visual studio do this?

    What makes you think that? Debugging is impossible in Release build, so anything it tells you is false.   I've changed the pulse.expand amount in the left window. Debug mode it is the correct size, in release it is acting as it was before. I'm not using debug-anything, I can literally see it with my eyes.
  5. why does visual studio do this?

    That isn't the issue. It won't recompile that cpp for some reason. it's using the old code.
  6. In release mode it won't update the file when i clean/rebuild   It hits the first breakpoint, but won't actually enter the function:     EDIT:   Also this problem makes no sense:     it is empty yet it's clearing? i have that if statement specifically to stop it from doing that.
  7. There is one struct, but there's no static methods. There's function declared static. It's not static method, and its body will be duplicated/inlined in every compilation unit.   As for linker error - you've declared map[][] array, but you didn't define it. One of .cpp files must have PFNode map[LARGEST_MAP_SIZE][LARGEST_MAP_SIZE]; line, without "extern" keyword. Having "extern" means "there's array, defined in one of object files. Use it from there, do not create instantiate of it".     There is one struct, but there's no static methods. There's function declared static. It's not static method, and its body will be duplicated/inlined in every compilation unit.   As for linker error - you've declared map[][] array, but you didn't define it. One of .cpp files must have PFNode map[LARGEST_MAP_SIZE][LARGEST_MAP_SIZE]; line, without "extern" keyword. Having "extern" means "there's array, defined in one of object files. Use it from there, do not create instantiate of it".     map array is in cpp, and thats not the error im getting. "static PFNode map[LARGEST_MAP_SIZE][LARGEST_MAP_SIZE];"
  8. Hi I have a weird error.   Here's my code with a bunch of unimportant stuff cut out: #pragma once struct PFNode { int gCost; int hCost; int fCost; int x, z; int id; PFNode* parent; bool blocked; bool checked; }; extern PFNode map[LARGEST_MAP_SIZE][LARGEST_MAP_SIZE]; static void InitPathFinder(World* world) { worldW = world->getTilesWide(); worldL = world->getTilesLong(); for (int z = 0; z < worldL; ++z) for (int x = 0; x < worldW; ++x) { map[x][z].x = x; map[x][z].z = z; map[x][z].id = x + z * worldW; map[x][z].blocked = world->getTile(x, z)->isBlocked; map[x][z].checked = false; } } So I get errors saying "1>EM_Component_Mover.obj : error LNK2001: unresolved external symbol "struct PFNode (* map)[256]" (?map@@3PAY0BAA@UPFNode@@A) 1>Game.obj : error LNK2001: unresolved external symbol "struct PFNode (* map)[256]" (?map@@3PAY0BAA@UPFNode@@A)"   I have this file included in 2 other files (one being EM_Component_Mover.h) so I'm guessing structs or static methods don't work how I think they do.   Any help is greatly appreciated.
  9. Ok so the Issue was with Assimp 3.1. I downgraded to 3.0 and now it works fine. 
  10.  I don't know I have uninstalled and reinstalled twice now, nothing fixed.     I have googled for hours now. Already seen that link and have downloaded dependancy program as he said, and i don't understand what im looking at. MSDN is no help either.
  11. When I do 32bit compilation, I get this error - "The application was unable to start correctly (0xc000007b)."   So apparently that means something's wrong with the dlls?   I used dependency checker on the 32bit exe and I get this:     Not sure what it means.       I fixed the release Mode error.
  12. Yes. L. Spiro   alright thanks for your help, greatly appreciated!
  13. Ok I think I got it fixed correctly.   I just added an if statement to the fragment shader:   if (color.a <= 0.1) discard;   and results look good now. Is this what you mean by alpha test?  
  14. Then it may be time to start posting shaders. As for parts of the quad disappearing where there seems to be leaves, your alpha test is likely too low. Raise it. L. Spiro   What's an "alpha test" ? you mean "glClearDepth(1.0);"?
  15. Because you don’t discard translucent/transparent pixels when generating the shadow map. Since you don’t have this problem on the ground shadows, I assume you are creating 2 separate shadow maps. The one you are using to shadow translucent objects is wrong.   This seems imaginary—nothing looks suspicious in your picture except a few spots that aren’t clear because of the shadow issue. Fix that first and then show a picture if this issue remains. L. Spiro     No, I'm using the same shadow map for everything, which is why this is so confusing.   For reference, here how it looks when modelling it: