Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

  1. If we are talking about vector container and multiple erasings on single iteration... Best way do not erase on itaration, becouse it will be data copy nightmare. You can instead of erasing element copy to its place next element and on end iteration resize vector; This will guaraty that one element wount be copied more than one time + resize copy.
  2. so is it posible on dx to merge several sprites to texture and get texture like merged layer on photoshop - change alpha chanel calculation
  3. :) its directx   but i know what you mean
  4. Yes you are right it becomes 0.3. I need a transparent texture, so ARGB must be. I just want to merge sprites as in photoshop layers :)   so is it possible that alpha chanel  for target texture not overwrites but adds  newAlphaChanel = 1 + 0.3
  5. i can understand what 3 means. 3 of what? ok target texture has alpha chanel 1   sprite has 0.3  , i render this sprite to texture , what alpha and colors i will get?
  6. Nahh,   bouth cases has blending mode enabled   1 case:   a) Clear screen with solid color  = ARGB(1, 1, 1, 1) (any solid color) b) Draw sprite with sprite color  = ARGB(0.3, 1 , 1 , 1)  (D3DRS_SRCBLEND, D3DRS_DESTBLEND as written in topic) (simple shader return textureColor * color;)   2 case: a) Clear screen with solid color  = ARGB(1, 1, 1, 1) (any solid color) b) Clear render target texture with solid color  = ARGB(1, 1, 1, 1) (all pixels alpha == 1) c) Render sprite to target texture color  = ARGB(0.3, 1 , 1 , 1)  (D3DRS_SRCBLEND, D3DRS_DESTBLEND as written in topic) (simple shader return textureColor * color;) d) Render target texture color = ARGB(1, 1, 1, 1) (than i render this texture it has all pixels alpha == 1)   problem apears on c). Render target texture has solid color for example yallow, rendering sprite with alpha == 0.3 the new pixel color should be finalColor = targetTexColor * (1 - 0.3) + spriteColor * 0.3  after that target texture renders to screen srcreeTexColor * 0.0 + renderTargetColor * 1.0   So...   1 case: screen color = yallow screen * (1 - 0.3) + sprite * 0.3   2 case: target color = yallow , screen color = any screen * 0 + (target * (1 - 0.3) + sprite * 0.3) * 1.0   Should be the same color , but but no....
  7. Yeah, this is two cases, than i render the same orange texture to screen and to texture , becouse it has alhpa chanel == 1.0 it apears in both cases the same exact color . There is no problem. Problem is colors with chanle alpha != 1.0; They becomes darker and grey independent on background.
  8. Hi, what would be so wonderfull if you guys help me to solve this problem. I cant get why rendering to screen buffers and to texture so differs.   Bouth screen and texture formats are identical A8R8G8B8, blending mode and params are exect SetRenderState( D3DRS_SRCBLEND,  D3DBLEND_SRCALPHA ); SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); but result so differs. Rendering to texture starting to become grey. I could imagine that it for sure could be gray(darker) if destination would be black. But its not. In bouth cases its filled with bold color with alpha == 1.0 I have tried lots of different params and states, so now iam desperate...  
  9. http://yourgameideaistoobig.com   unbeleavble numbers,   please add average artist salary in your country and your artistic-programing skills tables, I got 400000$ and 19 years on my project, but in true it took me just one year and hired one artist...
  10. I think there is no need to track server and client time differences in such games, becouse there allways will be latency between them. To avoid such problems related to this latency or time speed hacks client and server are working with village (or accaount) time life. Lets say cient sends some event (starting building upgrade) it sends together village life time shtamp. Server checks if it is possible to start this event (if its enough money in that lifetime shtamp) if so writes to database event, if not sends callback of problem. In such way theres no need to send events in exact time they accure, these events could be grouped and let say send once in a 5 minutes. If no events there made client sends ping. If ping or grouped events  didnt come more than (5 + some latency constant)  minutes server writes that client loged off. Becouse of maybe app crash of low battery client could not send logoff event. So theoreticaly these 5 minutes is time period there client can work without internet.
  11. serumas

    Multilevel Grid Spacial Partition

    I mean   (slower) for each object     mgsp.getCollisions(object, collidingNeighbors);   vs   (faster) broadphase.getAllPossibleColisionPairs(pairs); for each pair     doCollision(pair.a, pair.b);
  12. serumas

    Multilevel Grid Spacial Partition

    for each object     mgsp.getCollisions(object, collidingNeighbors);     // do what you want with this collisions   Note that this way we will only check the cells where the object belongs (very fast)   I dont agreee with this. Yeah its the worst scenario to find collisions. Ill suggest to change a grid concept a little bit and you can get much better performance becouse such implementation is doomed for poor performance. Good luck
  13. serumas

    Multilevel Grid Spacial Partition

    "The main objective of this data structure is to optimize the performance and memory usage in comparison with the normal grid space partitions."   I think the main objective of article is wrong. Lats say we have 30x30 cells , so we must to visit 900 cells and as author says half of tham are empty, so its perhaps max 0.010 ms job for pc. So we are trying to save this tiny time?   "The main problem with this data structure is that it's good only when the elements are uniformly distributed in space."   Its a problem for maybe all broadphase algorithms.   After lots of months spent on broadphase algorithms, mainly quadtree and grid, I would say that most memory and performance penalty goes to objects data structure. For example in my grid 10k circle objects (very tiny data structure) broadphase tooks ~0.6 ms, in more complicated data structure it tooks twice time. So you cant compare your results with oter peaple implementation results, until you recreate exact physical scene. So I can compare just my implementations, my optimized grid 5 times faster than my not fully optimized quadtree, but I dont believe that even optimized quadtree can beat grid becouse of multilayering, reqursion, harder insertion, harder iteration...
  14. serumas

    How to make a Game Engine For Super Beginners?

    If you want to become an expert some day, you must go this way and reinvent something every time.
  15. serumas

    SFML 2.1

    http://www.sfml-dev.org/documentation/2.1/classsf_1_1Texture.php#aa6fd3bbe3c334b3c4428edfb2765a82e     what about veretex, are there normalized texture coords? Think no , becouse I just copied that sentence directly from them documentation. Or its only in new version?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!