Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1461 Excellent

About _WeirdCat_

  • Rank

Personal Information

  • Website
  • Role
    3D Animator
    3D Artist
    Art Director
    Artificial Intelligence
    Audio Engineer
    Business Development
    Character Artist
    Concept Artist
    Creative Director
    Environment Artist
    Game Designer
    Level Artist
    Level Designer
    Pixel Artist
    Quality Assurance
    Sound Designer
    Technical Artist
    Technical Director
    UI/UX Designer
    Visual Effects Artist
  • Interests

Recent Profile Visitors

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

  1. _WeirdCat_

    Weapon recoil as spring?

    Youd netter get a gun and start shooting, you need great damping force to compensate second bend whenever gun is shooting it goes up, muscles compensate that force and gun moves a little bit lower or lets simplify that goes to initial position, anyway you need a damping function so it wont oscillate
  2. Its really possible, in fragment shader you just output the line color so either it can be a texture pixel or sqrt(e=mc^2) or cute little kittens there. You need to pass lets say a texturr coordinate, it really doesnt differs from drawing a textured triangle
  3. Just to add, handling text differs on unix based systems and windows - im talking about end of the line character, the same applies for socket programming
  4. If you have different line width on diffndevices either your drawing routine is wrong, or you might need to set glLineWidth, or you just simply see a difference on different screen sizes resolutions - but they always should be the same. And you can texture lines aswell.
  5. _WeirdCat_

    Need help with ssao

    And actually i came up with outline shader rather than ssao im quite satisfied with results anyway, user can clearly see depth, however not in all cases cause whenever 2 diff surfaces have the same normal algorrithm cracks and doesnt profuce an outline and whenever two geometric shapes stick together i get darkened bonded areas but well it aint that bad, so what i do now is the algo from first post but now i use a normalmap to see if im testing against samensurface (well same normalbtruth to be told) i could use some sort of instancing (not instancing in the meaning if it) but i could draw different colors for each surface and check whenever it doesnt match so i can improove that outline ssao wannabe thing and few scrs ­čśť
  6. _WeirdCat_

    Need help with ssao

    Ok so now i see only an outline a a bunch of white circles if im close enough to geometry. What i do Draw depth to texture Draw normals to texture Draw vectors perpendicular to normals to texture Now in ssao shader Reconstruct actual depth and world position - fragmentwpos Construct a rotation matrix out of normal, perpendicular vector and normal x perpend_vec Go through all samples { Rotate sample by matrix New sample pos=fragmentwpos+rotated_kern_sample*ssao_radius; Muktiply that pos above by mvp matrix and get 0..1 coordinates from that so i can sample depth map and get its value } And that should contribute to overall fragment occlusion factor - if somethings wrong in way im doing it please tell me (all normals, positions, tangents are in worldspace)
  7. _WeirdCat_

    Need help with ssao

    Sampling´╗┐ depth values around the pixel without view space wouldn't´╗┐ work because for one thing you need to be in view space´╗┐´╗┐ to get the correct depth values as Z v´╗┐a´╗┐lues´╗┐´╗┐´╗┐ And here why i tried my way of doing this i thought that im sampling anyway depth values around a fragment so why not just sample fragments around, i think i get your point of view - fornflat surfaces i get alwaysnocclusion thing when while using normals none of samples would intersect the same surface leaving it full bright... Well back to coding then....
  8. I try to implement ssao, i've read few tutorials and they use view space calculations - like you need a texture with viewspace positions of each fragment blablabla, but what are the numbers that define viewspace are they in range of 0..1? How do i multiply a vertex by view matrix do i use matrix row 4th component too to calculate it? Additionally i would like to ask what was the difference in vertex 4th component? I recall that 1.0? were for positions and 0.0 were for vectors right? So if i want to calc viewspace normal i dont then use 4th matrix row component at all? So i decided to reinvent a wheel (......) Forget about view space, perspective divisions and kerenels random vectors - just sample all pixels around each pixel and compare their depths to find occlusion value... And i came with that ugly result,(see attachement maybe i could improove it. And if not i would like to not use viewspace thing cause i have no imagination on that kind of thing and rather use worldspace but still maybe theres a way of doing ssao without involving rotation of kernel samples, i would like to avoid filling tangent information to gpu buffer and calculating rotation matrix for world space solution of this kind of thing.
  9. Dont treat my answer as solution cause i may be wrong, first of all you apply forcrs yo the ball, gravity, friction (important), air drag, and tge force yyou are kickin bal with if exists (not important), Then you move ball from last position to new position and apply continous collision detection to see how much the ball penetrated the surface it collided with, not to mention yoi correct the ball position and apply the bouncr based on the length of penetration vector (you apply the force based on reflection formula i guess, anyway not a simple topic
  10. _WeirdCat_

    UDP Confusion c++ sockets

    Actually when it returns -1 i repeat write until all is written so this is a bug, additionally whenever write returns 0 or more (i dont check if its less than requested) then i repeat write intil all is written so heres another bug then while (!sentall) { iteration++; if (count >= cmdlen) break; if (iteration > 1500) break; if (len_to_write <= 0) break; //we shouldnt even be here but ill add log exception int wb = write(sockfd, &pdata[ count ], size_t( len_to_write )); if (wb < 0) { fails = fails + 1; if (fails >= max_write_fails) break; } if (wb >= 0) { count = count + wb; len_to_write = len_to_write - wb; // ALOG("WROTE: "+IntToStr(wb)+" bytes"); } if (count >= cmdlen) { sentall = true; break; } } So from what you said i whenever write is -1 or less than write bytes requested i do another select and check if socket isbready to write and then write rest of data? Well thats a bit overcomplicated but if its worth it ill try.
  11. #define k 1 #undef k or #define k 0 #ifndef k #ifdef k #elseif
  12. _WeirdCat_

    UDP Confusion c++ sockets

    Since i couldnt figgure how to avoid disconnection while using nonblocking mode ive changed the cise to use blocking ones with a bit of improvement For nonblocking case: I dont write more bytes than i want, and write them only when socket is ready for write but it still disconnects...
  13. _WeirdCat_

    UDP Confusion c++ sockets

    So from what you say it seems i have a problem within write. But yet int wb = write(sockfd, &pdata[ count ], size_t( len_to_write )); And then in while loop i do len_to_write = len_to_write - wb; so i may not write more cause i dont even anywhere else set the max tcp buffer size. Now I've´╗┐´╗┐´╗┐tried to write more bytes than the write buffer will´╗┐´╗┐hold because I haven't checked to make sure th´╗┐e socket is available for writing. ´╗┐ Well im checking whenever fd is ready for writing then i do while loop until whole message(a string with x characters (may be lets say 2000 chars)) is written with write so there could be a problem const int max_write_fails = 180; inline int SendStrToFd(unsigned char * pdata, int cmdlen, int sockfd) { bool sentall = false; int count = 0; int iteration = 0; int fails = 0; int len_to_write = cmdlen; while (!sentall) { iteration++; if (count >= cmdlen) break; if (iteration > 1500) break; if (len_to_write <= 0) break; //we shouldnt even be here but ill add log exception int wb = write(sockfd, &pdata[ count ], size_t( len_to_write )); if (wb < 0) { fails = fails + 1; if (fails >= max_write_fails) break; } if (wb >= 0) { count = count + wb; len_to_write = len_to_write - wb; // ALOG("WROTE: "+IntToStr(wb)+" bytes"); } if (count >= cmdlen) { sentall = true; break; } } if ( sentall ) return 1; else return -1; }
  14. _WeirdCat_

    UDP Confusion c++ sockets

    I've managed to get good results with blocking sockets, i just need not to write too much data through sockets and it does pretty well. I just Thread2 { If flag1 continue For each peer Read Write Flag1 = true; } Thread1 { If flag1 ProcessPackets Flag1 = false } Thanks for all
  15. _WeirdCat_

    UDP Confusion c++ sockets

    but can this be causing epipe? this doesnt still explain loosing connection, and now I have the same behavior but now server sends commands and client receives lol, I hguess my best pick would be to rewrite blocking sockets handling so each threaded frame, after passing all reads ill process any received packets then send any other data to peer. odd thing is noone has ever mentioned anything about strange epipe coming as soon as one of peers tries to communicate. even when everthing has been read and write flag is marked to true. so it should be safe to write. you know select(sockfd,&readfds, &writefds) if fdisset(sockfd, readfds) while (read !=0) read(sockfd) if fdisset(sickfd, writefds) send all data should work but apparentely not
  • 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!