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
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);
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.
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...
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.
Fixed it.. Damn cullmode. Thanks Fallen. http://i48.tinypic.com/zlpumg.jpg Still some bugs left though, but I think I have it now =)
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.
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.