Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

250 Neutral

About QQemka

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

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

  1. Hello. I've got a problem with swapping shaders in one render. I am rendering HUD (2d user inteface over previously rendered 3d scene). The structure is not complex, tree-like: there are multiple movable windows containing texture background and optinally some textboxes, buttons, radiobuttons and statictexts (each widget type having own dedicated shader). The gui windows may overlap eachother (one used last should be on top of previous). So the rendering works like this - interate over the list of windows (which are sorted from back to front) and render each. Rendering single window - use button shader, set uniforms, render all buttons, then use textbox shader, set uniforms, render all texboxes, use statictext shader, set uniforms render all etc... As you can see i am rebinding the same shader multiple multiple times during one render. But i kind of have to? I cannot find another solution. If i render all buttons first and then for example textboxes, the textbox from window behind can overwrite previously draw button from front window. The depth test is obviously disabled for HUD rendering (what i draw last is on front). Actually maybe that's the solution to use depth buffer in some tricky way (bumped onto it while writin the post)? Thanks for all suggestions
  2. Hello. So far i got decently looking 3d scene. I also managed to render a truetype font, on my way to implementing gui (windows, buttons and textboxes). There are several issues i am facing, would love to hear your feedback. 1) I render text using atlas with VBO containing x/y/u/v of every digit in the atlas (calculated basing on x/y/z/width/height/xoffset/yoffset/xadvance data in binary .fnt format file, screenshot 1). I generated a Comic Sans MS with 32 size and times new roman with size 12 (screenshot 2 and 3). The first issue is the font looks horrible when rescaling. I guess it is because i am using fixed -1 to 1 screen space coords. This is where ortho matrix should be used, right? 2) Rendering GUI. Situation is similar to above. I guess the widgets should NOT scale when scaling window, am i right? So what am i looking for is saying "this should be always in the middle, 200x200 size no matter the display window xy", and "this should stick to the bottom left corner". Is ortho matrix the cure for all such problems? 3) The game is 3D but i have to go 2D to render static gui elements over the scene - and i want to do it properly! At the moment i am using matrix 3x3 for 2d transformations and vec3 for all kinds of coordinates. In shaders tho i technically still IS 3D. I have to set all 4 x y z w of the gl_Position while it would be much much more conventient to... just do the maths in 2d space. Can i achieve it somehow? 4) Text again. I am kind of confused what is the reason of artifacts in Times New Roman font displaying (screenshot 1). I render from left to right, letter after letter. You can clearly see that letters on the right (so the ones rendered after ones on the left are covered by the previous one). I was toying around with blending options but no luck. I do not support kerning at the moment but that's definitely not the cause of error. The display of the small font looks dirty aliased too. I am knd of confused how to interpret the integer data and how should be scaled/adapted to the screen view. Is it just store the data as constant size and again - use ortho matrix? Thanks in advance for all your ideas and suggestions!
  3. I just did it the standard way
  4. Hello there. What is the easiest way to draw aabbs for my scene? I already have all the maths implemented but showing it on screen is not so trivial. Having a dedicated shader just for aabbs seems like overkill, or is it the standard way? Is it possible to code shader in a way that i'd just send the min/max point instead of setting up one template cube and passing the xyz scales and location?
  5. QQemka

    Kinda navmesh with ability to fall down

    All i want to do is to be able to move freely over my scene AND be able to jump/slide down the slope to the lower walakble area. Imagine a stairs with step too high for our character to step higher. I want him to be able to fall down to the lower positioned level. See? If i had a slope and a round, smooth way up to the top, then the only way to get to the top would be to walk the way. But if i wanted to get down, i would just fall down at the nearest edge
  6. Hello. Since 3 days I am unsuccessfully trying to find way to generate navigation data to be used for 3d click to move in the scene (game level). The navmesh generators (like Recast) are fine except for I need ability to fall down (along vertical axis) from higher positioned, walkable area's edge. Imagine a flat square and a bigger square below it. I would like to be able to jump directly down from the edge (in any point of the edge where there is walkable ground directly below). The scene is created in blender, i got access to all the triangles obviously and that's no problem for me to pre-generate the data structure representing walkable areas, so it is not a problem if it's performance heavy to generate. How can achieve that? All suggestions are appreciated, thanks in advance.
  7. Hello. I am coding a small thingy in my spare time. All i want to achieve is to load a heightmap (as the lowest possible walking terrain), some static meshes (elements of the environment) and a dynamic character (meaning i can move, collide with heightmap/static meshes and hold a varying item in a hand ). Got a bunch of questions, or rather problems i can't find solution to myself. Nearly all are deal with graphics/gpu, not the coding part. My c++ is on high enough level. Let's go: Heightmap - i obviously want it to be textured, size is hardcoded to 256x256 squares. I can't have one huge texture stretched over entire terrain cause every pixel would be enormous. Thats why i decided to use 2 specified textures. First will be a tileset consisting of 16 square tiles (u v range from 0 to 0.25 for first tile and so on) and second a 256x256 buffer with 0-15 value representing index of the tile from tileset for every heigtmap square. Problem is, how do i blend the edges nicely and make some computationally cheap changes so its not obvious there are only 16 tiles? Is it possible to generate such terrain with some existing program? Collisions - i want to use bounding sphere and aabb. But should i store them for a model or entity instance? Meaning i have 20 same trees spawned using the same tree model, but every entity got its own transformation (position, scale etc). Storing collision component per instance grats faster access + is precalculated and transformed (takes additional memory, but who cares?), so i stick with this, right? What should i do if object is dynamically rotated? The aabb is no longer aligned and calculating per vertex min/max everytime object rotates/scales is pretty expensive, right? Drawing aabb - problem similar to above (storing aabb data per instance or model). This time in my opinion per model is enough since every instance also does not have own vertex buffer but uses the shared one (so 20 trees share reference to one tree model). So rendering aabb is about taking the model's aabb, transforming with instance matrix and voila. What about aabb vertex buffer (this is more of a cosmetic question, just curious, bumped onto it in time of writing this). Is it better to make it as 8 points and index buffer (12 lines), or only 2 vertices with min/max x/y/z and having the shaders dynamically generate 6 other vertices and draw the box? Or maybe there should be just ONE 1x1x1 cube box template moved/scaled per entity? What if one model got a diffuse texture and a normal map, and other has only diffuse? Should i pass some bool flag to shader with that info, or just assume that my game supports only diffuse maps without fancy stuff? There were several more but i forgot/solved them at time of writing Thanks in advance
  8. QQemka

    Looking for a coder to work with

    What kind of game are you trying to create? I'm a coder.
  9. Hello. I've got problem shadow mapping. For some reason, the buildings are not casting shadows properly. The red, blue, green lines are positive XYZ axes respectively. White line is direction of the directional light (it's end is at xyz 60,30,60 which is used to construct the view matrix). This is the effect I am getting This is, where i think the shadows should also appear (red circles) That is my scene when instead of using camera view/projection i use light view/projection Shaders are from this tut: Why are shadows not complete near the house edges? On the other hand, when I use projection matrix instead of ortho for the light, i am getting no shadows at all (but rendering the scene from light's point of view gives me nice view of the city)
  10. Hello. I am struggling with moving to deferred shading with framebuffers. I got forward rendering working perfectly. I am following this tutorial My code is doing the same thing, but the textures (position, texcoord, normal, diffuse) are black, just like nothing gets rendered (but i know the draw calls are executed). The uniforms are correct, textures also, i have extensive error checking in all modules Pieces of code: framebuffer.hpp framebuffer.cpp function responsible for rendering deffered shader forward shader   What may be wrong? Thanks in advance   Edit: Being a master of copypasta, for some reason I've ommited " glBindFramebuffer(GL_FRAMEBUFFER, fbo_); " call. Now everything works just fine.... :D
  11. QQemka

    Mipmap management

    Configured correctly? All i do is load dds with pregenerated mipmaps and the whole magic is done automatically in the background. And thats what im worried about, i dont have manual control over it. Am i missing something?
  12. Hello. I generate a dds texture with mipmaps (2^n x 2^n down to 1 x 1), compress it and use without problems. But I couldnt find information on how to actually use higher/lower quality mipmaps. Do i need to somehow explicitly say which mip do I want now, or GPU somehow knows which one is most suitable?
  13. QQemka

    Create Dx Texture

    What is the problem exactly? What additional features does your texture have so you cannot convert it to any other known format?
  14. And i checked on paper with proper transposing, and still it turns out that the "good" order is wrong according to math. It turns out that mul(a,b) does b*a and not a*b...
  15. Well, i know a lot of linear algebra, the matrices, transpositions, multiplication order etc. I suspect hlsl does something implicitly i dont know about...
  • 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!