Jump to content
  • Advertisement

pindrought

Member
  • Content Count

    44
  • Joined

  • Last visited

Community Reputation

115 Neutral

About pindrought

  • Rank
    Member

Personal Information

  • Interests
    Programming

Recent Profile Visitors

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

  1. pindrought

    Accepting IPv4 connections as IPv6 Server

    Great reply! This makes perfect sense. Thanks so much for the detailed explanation.
  2. I am trying to accept IPv4 connections on my server that is listening on an IPv6 TCP socket. I was currently working on porting a blocking socket example i'm using for some tutorials i've been making, and i've noticed behavior that I did not expect. Current github dev branch: https://github.com/Pindrought/PNet/tree/TCP_Blocking_Winsock_Tutorial_17Dev My client is connecting using an IPv4 socket. My server is accepting connections on an ipv6 socket, and i've disabled the IPV6_V6ONLY socket option to allow both ipv4 and ipv6 incoming connections. The connections are accepted just fine - the confusion for me arises in the fact that the accepted connection appears to be an IPv6 connection according to the address family in the sockaddr struct. https://github.com/Pindrought/PNet/blob/TCP_Blocking_Winsock_Tutorial_17Dev/PNet/PNet/Socket.cpp#L128-L145 I was under the impression that the ipv4 connection would have an address family of AF_INET6. Is this expected behavior? I just want to make sure that i'm not doing anything wrong here. If this is expected behavior, is there any way I can determine from the server side if the connecting client did so using IPv4 or IPv6? Thanks! Edited to add: This is the output my server has
  3. pindrought

    SO_REUSEADDR - when should this be used?

    Thank you both! Very useful information. I'm going to refrain from using it for now.
  4. I thought I understood this socket option before, but now i'm unsure. I read an article talking about how the functionality is different on windows and linux and some people suggesting this should never be used on windows. I initially thought that this was to allow a server to start back up and bind instantly after a crash and not having to wait for the socket that was being listened on to exit TIME_WAIT. I'm currently using windows 10 and have been unable to produce a situation where i'm unable to bind a socket after a server crash. Can anyone give me a scenario on when I should be using SO_REUSEADDR and how to force a situation to occur where its use can be observed?
  5. pindrought

    WICTextureLoader sometimes fails

    What is the HRESULT value you're getting when it fails? Do you have the debug layer enabled when you create the device/swapchain? Do you get any error messages in the output window regarding the failure?
  6. I originally thought that when listening on a port, that all accepted connections would be on their own unique local ports. However, recently I was reading someone say that this isn't necessarily the case and the only thing unique was the ip+port combination. This got me wondering - is it possible that when you accept a new connection, that the local port assigned for that socket to use is the same as the port being used to accept new connections? Also, is it possible that two new connections would be accepted that are using the same local port (but different endpoint ips)? Thanks
  7. pindrought

    Question regarding UDP punchthrough.

    Thanks a lot this is really helpful to me. I appreciate the info.
  8. pindrought

    Question regarding UDP punchthrough.

    Thanks for the reply. I was thinking this might be how it works. Is there any trick to figuring out how often data must be transmitted to keep the port mapped with the lan client?
  9. So I was thinking about setting up a basic UDP punchthrough system like so. Server: Creates a socket and binds to a specific port that the clients will send messages to to either request to be a host or request host information. Listens for client A to send packet requesting to host. Captures the port being used from the packet that was received. Stores this ip/port. Listens for client B to send packet requesting host information. If the port/ip has been stored from client A, then the server will send the ip/port to client B. Once client B receives the packet from the server about client A's ip and port combination being used, client B will begin transmitting packets to packet A and vice versa. One thing I am confused about however - how can I make sure that the port will remain tied to client A on the router? (Same with client B - how do you ensure that the port will remain tied to that specific client on the LAN?) This part confuses me since bind is never called. When a new socket is created using socket(), is a port at that point determined and somehow kept tied to that client on the LAN until the program ends? Thanks
  10. I'm trying to find a good way to draw a silhouette of an object. The particular mesh I am looking at is the nanosuit obj for the model from crysis. The .obj and its related textures can be found here: https://github.com/JoeyDeVries/LearnOpenGL/tree/master/resources/objects/nanosuit My idea was first to draw the object normally with a null pixel shader and just update the stencil buffer by incrementing the values it would draw to. Then, i'd use a depth stencil state where I only draw to the pixels where the stencil buffer value is equal to 0 (pixels where the original object did not draw). I was thinking that for the outline I could just have a vertex shader that extends the vertices out a bit by a fraction of their normals. Something like this... #pragma pack_matrix( row_major ) cbuffer perObjectBuffer : register(b0) { float4x4 wvpMatrix; }; struct VS_INPUT { float3 inPos : POSITION; float3 inNormal : NORMAL; }; struct VS_OUTPUT { float4 outPosition : SV_POSITION; }; VS_OUTPUT main(VS_INPUT input) { VS_OUTPUT output; output.outPosition = mul(float4(input.inPos + input.inNormal * 0.1f, 1.0f), wvpMatrix); return output; } For my pixel shader for drawing the silhouette, I was going to use something like this. struct PS_INPUT { float4 inPosition : SV_POSITION; }; float4 main(PS_INPUT input) : SV_TARGET { return float4(1.0f, 1.0f, 1.0f, 1.0f); } However, there are a couple of problems with this approach. The first issue is that I can see lines where there are openings inside of the model. This is not a big deal, but it is an isssue none the less. The next issue is I can see some lines in the actual outline of the model. Here is a video demonstrating the issue. The inconsistency in the outline of the object can be observed in the first half of the video. The second half demonstrates the openings inside of the object's silhouette. Is this just an issue with the model itself or is there something I could do to fix this? I am using assimp to load the model and I tried having one of the importer flags to be to smooth the normal, but it still didn't seem to fix my issues.
  11. Sorry I misread your post. I was thinking you were saying to use a null pixel shader. Thanks for the example. I didn't know you could actually have it return void. Edited to add: Just tested and this seems to be much better performance doing it this way. Thanks again!
  12. That's what I was doing before I needed to take the transparency into account for the texture. However, that wont work when I need to take the transparency into account because that will just use the whole quad for the stencil.
  13. It works fine if I go back to using my pixel shader where i'm discarding the pixels but that seems to defeat the purpose of setting up a blend state and masking over the alpha values. Edited to add: Actually, just ran some tests and it seems like if I use the discard method combined the masking over the alpha values that it is a slight performance increase. Interesting.
  14. I'm still not understanding what you mean by alpha masking enabled and I can't find any examples regarding alpha masking in dx11. I've tried setting up a blend state that only takes alpha into account, but i'm still getting the same result as before where it seems like the transparency is being completely ignored by the stencil buffer.
  15. How would I do that using the stencil buffer?
  • Advertisement
×

Important Information

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

GameDev.net 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!