serumas

Member
  • Content count

    96
  • 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. 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.
  12. 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?
  13. SFML 2.1

    For me in SFML there are several stupid things   its a int mixing with float in texture size(why these cast) and texture coordinates are defined in pixels (they are not normalized (between 0.0 and 1.0f), as people who are used to graphics programming would expect).
  14. Introduction to Octrees

    Im not a fan of quadtree or octree, but must admit that article its one of the best...