• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

wildboar

Members
  • Content count

    109
  • Joined

  • Last visited

Community Reputation

320 Neutral

About wildboar

  • Rank
    Member

Personal Information

  • Location
    UK London/Hull
  1. I've posted about this in this thread http://www.gamedev.net/topic/683796-decal-projection-quick-question-on-direction-of-implementation/ As per your option 1. Tip. As the circles are a distance away from the camera plane. You can use a render target resolution for your circles which is less than your display resolution workout loss of quality.   Ah nice project you have! So you ended up doing the shadowmap method? Do you think that's the perfect way to do it or do you think deferred decals are an improvement to that technique?
  2. Hi, thanks for the reply. The reason I want projective textures is because it looks a lot more proffesional and not a quad that intersects the terrain that is used in older games. Presentation goes a long way for me and having the circles bend shape with the terrain is the effect I want. WoW was doing this back in 2004? At this point I am considering implementing deferred rendering.
  3. I am trying to implement unit selection circles, like the ones you see in starcraft 2 when you select a bunch of units. I am doing this for a mobile phone game so I have access to OpenGL ES 3.0.   I know there is some technique called deferred decals but since I am not using deferred rendering it seems like it's not for me. I mean if it was faster to do it with deferred I could go ahead and implement it using pixel local storage or something? but that's another idea.   So I narrowed it down to 2 ideas but I am not sure which one makes more sense:   1) Take a 2048x2048 texture and draw quads into it at the unit positions from a camera thats looking down at it. Basically same as a shadowmap but writing circles into a color buffer instead of only using the depth buffer. When drawing the scene just sample this texture as I would a shadowmap.   2) Draw the scene and pass into it an array of matrices which are like the cameras looking down onto the unit position. In the fragment shader do a loop over these matrices and perform some kind of projection technique to see if that pixel is sampling a circle. This would limit the amount of circles by 32 maximum in a scene.   Any other ideas? I really have no clue how starcraft 2 implements this but they could very likely be using the deferred decal technique. I don't want to just draw circles as quads as it looks bad when they intersect the floor and stuff, and with depth test disabled it also looks bad. If its a huge resource hog for current mobile devices maybe I should abandon this idea altogether? really stuck at the moment.
  4. I am trying to use UVAtlas code from github in order to create a uv atlas for a 50k triangle scene.   I am beyond confused right now because of the data it returns to me:   { size=298 }   //Input vertices { size=564 }   //Input indices { size=564 }   //Input adj info, filled with -1 { size=564 }   //Output vertices { size=2256 } //Output indices but these are uint8 { size=564 }   //Output remap array { size=188 }   //Output face partitioning array 0.000000000 //Output stretch 188                //Output charts count   Log:   UVAtlas: Vertex Number:298   UVAtlas: Face Number:188   UVAtlas: Scale factor is 24.978756 UVAtlas: Initially having 188 separated charts UVAtlas: Initial chart number 188   UVAtlas: Charts before merge 188 UVAtlas: Charts after merge 188 UVAtlas: Final space utilization ratio after pack = 63.167% UVAtlas: Final X and Y = 998, 998   1) Why does it return so many vertices? why does it return indices in that weird form? What does it expect me to do? I just have a list of vertices and I need UV coords generated for each one, not more, not less! why does it give me all these extra vertices???   2) How do I actually generate the texture/lightmap from this? By lightmap I mean a lightmap without the lighting computed yet.   3) Should I just not use this tool and use libigl instead?   Thanks all
  5. I had an idea to use a render to texture method in my game to be able to have blood splats on the ground, like sc2 creep, splatoon's paint or portal 2's gel. I need some help making a plan on how to make this work, here are my ideas so far:   1) The 3D scene is a terrain with some buildings on it, take the scene bounding box's min plane and store it as a separate plane. 2) Raycast into this plane, alternative method is to raycast the physics engine collision mesh? 3) Make a texture for the plane during scene init, but keep the texture within a reasonable dimension, 2kx2k? 4) Render whatever we want to this texture and let the scene shader's sample it.   That's the rough idea, how comes the hard part, so we have the ray intersection point for either the plane or the triangle on the mesh.   1) How to find that point on the texture? 2) How to generate the new texture coord's for the scene meshes? 3) Should I be using some kind of unwrap uv like OpenGI http://opengi.sourceforge.net ? 4) What about the technique projective texturing? I know it is similar to a shadowmap, just not sure if that's what I need, the entire scene can be covered at any one point by the blood/gel/creep material.   Any help would be appreciated! Thanks.
  6. Thanks for the info   PrevVel is actually a velocity vector for the main player, it is assumed to be above 0.
  7. I have a small function:       bool CanSee(UnitInstance * Me, Vector3& Him) { Vector3 NN1 = Me->Pos - Him; Vector3 NN2 = Me->PrevVel; NN1.normalize(); NN2.normalize(); return(Vector3::dot(NN1, NN2) < 0.0f); } This gives me too wide of a field of view check, this is between enemy and player used for stealth system. How can I make it a lesser FOV?
  8.   Sorry what do you mean by that? any sample code would be apreciated. I just added w /= d and v /= d before the if(GetUV) and it produces numbers below 1 now how a uv should be.
  9. I actually did not write that function, its in a library called recast (for navmesh generation).   I have modified it like this and left some comments can you have a quick look please:       static bool intersectSegmentTriangle(const float* sp, const float* sq, const float* a, const float* b, const float* c, float &t, bool GetUV, const float* ta, const float* tb, const float* tc) { float v, w; float ab[3], ac[3], qp[3], ap[3], norm[3], e[3]; rcVsub(ab, b, a); rcVsub(ac, c, a); rcVsub(qp, sp, sq); // Compute triangle normal. Can be precalculated or cached if // intersecting multiple segments against the same triangle rcVcross(norm, ab, ac); // Compute denominator d. If d <= 0, segment is parallel to or points // away from triangle, so exit early float d = rcVdot(qp, norm); if (d <= 0.0f) return false; // Compute intersection t value of pq with plane of triangle. A ray // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay // dividing by d until intersection has been found to pierce triangle rcVsub(ap, sp, a); t = rcVdot(ap, norm); if (t < 0.0f) return false; if (t > d) return false; // For segment; exclude this code line for a ray test // Compute barycentric coordinate components and test if within bounds rcVcross(e, qp, ap); v = rcVdot(ac, e); if (v < 0.0f || v > d) return false; w = -rcVdot(ab, e); if (w < 0.0f || v + w > d) return false; // Segment/ray intersects triangle. Perform delayed division t /= d; //d ends up 3676338.0 here //It is about to return true so it means its a triangle hit but the v + w end up as 1315396.8 + 1609470.5 = 3676338.0 if(GetUV) { Vector2 v1 = Vector2(ta[0], ta[1]); Vector2 v2 = Vector2(tb[0], tb[1]); Vector2 v3 = Vector2(tc[0], tc[1]); Vector2 UV = v * v1 + w * v2 + (1 - v - w) * v3; } return true; }
  10. Ok so if those values are correct, how am I supposed to get my uv coordinate? it comes out with crazy numbers with that formula you showed me.
  11. Thanks for the help I am trying that line of code you showed me, however after debugging I noticed that v and w are giving me very strange values: v:  1213134.3 w: 1669297.8   Now the raycast itself is actually working so I am really confused? what values should v and w normally be?
  12. I have a function like this from recast, its a function that tests if a triangle gets intersected by a ray:       static bool intersectSegmentTriangle(const float* sp, const float* sq, const float* a, const float* b, const float* c, float &t) { float v, w; float ab[3], ac[3], qp[3], ap[3], norm[3], e[3]; rcVsub(ab, b, a); rcVsub(ac, c, a); rcVsub(qp, sp, sq); // Compute triangle normal. Can be precalculated or cached if // intersecting multiple segments against the same triangle rcVcross(norm, ab, ac); // Compute denominator d. If d <= 0, segment is parallel to or points // away from triangle, so exit early float d = rcVdot(qp, norm); if (d <= 0.0f) return false; // Compute intersection t value of pq with plane of triangle. A ray // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay // dividing by d until intersection has been found to pierce triangle rcVsub(ap, sp, a); t = rcVdot(ap, norm); if (t < 0.0f) return false; if (t > d) return false; // For segment; exclude this code line for a ray test // Compute barycentric coordinate components and test if within bounds rcVcross(e, qp, ap); v = rcVdot(ac, e); if (v < 0.0f || v > d) return false; w = -rcVdot(ab, e); if (w < 0.0f || v + w > d) return false; // Segment/ray intersects triangle. Perform delayed division t /= d; return true; }   The trouble I am having is that I now have attached some uv coords to the vertices, how can I find out the interpolated uv coord from 3 uv coords of those 3 vertices that go into the function. I need to do something with that t value to get the point in the triangle where the ray hits and then use that to calculate my desired uv coord to output. What I want to achieve is to be able to raycast a triangle and get a uv coord at the point where the ray intersects.   Thanks in advance.
  13. I am trying to make a simple turret system without using skeletal animation. I have 2 meshes, turret base and the turret itself. I am trying to attach a particle emitter to the ends of the turret where the cube is like this: http://imgur.com/tbely I just rotate the turret mesh around the y axis and it looks like its aiming for something, but I tried to rotate the cube around the turret using the same rotation matrix and it never aligns properly Is there some different way I should be doing this? do I really need to use bones and animation files for this? there must be a simpler way of handling this.
  14. there are a few demos with full source code in google just search 'screen space god rays' or 'screen space sun-shafts' and look at results on first page. I have used those when making it in my engine.
  15. I am trying to implement a simple blob shadow for a low spec game. I need to implement it in the most efficient way possible since there is no much ms left to spare per frame to rendering. 1) Is it possible to somehow get fragments position in the shader and when rendering the ground get xyz position of player and make the shader draw a black circle shape? 2) Raycasting the ground from player feet downwards 2000.0f units and drawing a quad at that position. Should I raycast the entire mesh every frame like this or skip frames or what? Is this a good method to do it? 3) Any other easy method to do it?