Pixel Shader Help

Discussion in 'Xbox 360 Development' started by LoveMHz, Jun 3, 2010.

  1. LoveMHz

    LoveMHz Guest

    HLSL Shader Help

    Not sure if this is the correct section or not, but what the hell.. First off I'm quite new to HLSL and I've been having problems left and right. I thought I understood it fairly well until I could not draw vertexes with color.
    :dammit:

    Rendered with Primitive Type: D3DPT_LINESTRIP
    http://lovemhz.teamxelove.com/192.168.137.3-image7.jpg

    Rendered with Primitive Type: D3DPT_TRIANGLELIST
    http://lovemhz.teamxelove.com/192.168.137.3-image9.jpg

    Test Source:
    http://pastebin.ca/Y7cW9xar
    Password: pass

    Thanks,
    LoveMHz
     
    Last edited by a moderator: Jun 3, 2010
  2. TheFallen93

    TheFallen93 Spirited Member

    Joined:
    Apr 22, 2009
    Messages:
    167
    Likes Received:
    68
    Looks like these verts are in a triangle list. Although your culling is ass backwards. But that could just be because your rendering it as a wireframe and not as a solid mesh. You may have to re-arrange the verts and play around with the culling and fill mode. I'll play around with this some tomorrow, here's examples on setting the cull mode and fill mode:

    g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
    g_pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
     
    Last edited: Jun 3, 2010
  3. LoveMHz

    LoveMHz Guest

    I played around with cullmode yesterday without much luck. I'll see what the different fillmodes do when I get home. Hopefully it's not an issue with the arragement with the verts. I need to reupload the code though, I accidently had my ARGB mixed up.
     
  4. le uberfry

    le uberfry Member

    Joined:
    Dec 28, 2009
    Messages:
    24
    Likes Received:
    0
    D3DPT_TRIANGLELIST is correct but I think you're ignoring the alpha value (it's 0xFF everywhere I see)
    How do you expect it to achieve transparency when it's all overlaying each other? :)
    Maybe you want to use a specific color to specify transparency? I don't know... in that case, I'd adjust the ps/vs for it...
     
  5. LoveMHz

    LoveMHz Guest

    0xFF is used in the HLSL Triangle sample and works (Which is what the above code is based on for simplicity). No idea why its not working.
     
  6. LoveMHz

    LoveMHz Guest

    Last edited by a moderator: Jun 4, 2010
  7. KIWIDOGGIE

    KIWIDOGGIE Peppy Member

    Joined:
    Jul 9, 2008
    Messages:
    357
    Likes Received:
    15
    You also need to make sure your ZBUFFER is set to the correct thing, it looks like your zbuffer is set up for a buffer wallhack style. I make hacks for PC games and do D3D. Heres a sample.

    Pretty much chams in a nutshell, but you can see how you can do whatever you want with the right stuff.
     
  8. le uberfry

    le uberfry Member

    Joined:
    Dec 28, 2009
    Messages:
    24
    Likes Received:
    0
    The colorful "primitives" are inside the gray primitives, which is why I thought that maybe you'd forgotten the alpha layer...
    Look at it this way - fat guy is in front of the whole theater, you can't see shit, so you shout: "yo bro, your alpha layer ain't nowhere near 0!"
    Otherwise, code a vs/ps to convert a specific color (here: gray? I'd pick pink) into the alpha value.
     
  9. LoveMHz

    LoveMHz Guest

    And that clarifies the next bug on the list. Thanks bro. Ohh I mean You Go Girl!
     
    Last edited by a moderator: Jun 4, 2010
  10. le uberfry

    le uberfry Member

    Joined:
    Dec 28, 2009
    Messages:
    24
    Likes Received:
    0
    nvm
     
    Last edited: Jun 5, 2010
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page