Forum

Help adding 3dModels to dx11 particle systems

Attached is a patch demoing what I’ve been trying to do.
I’ve got a gourand shaded model working (kind of, lighting looks a bit weird) but thought I’d try and use the LitSphere which is where its gone a bit wierd.
Comments are in the patch.
Open ParticleSystem_07_Shaded (emitterCol, rndSize).v4p

As soon as you uncomment these lines in the VS
// float4 Tangent : TANGENT;
// float4 Binormal : BINORMAL;
the shader stops outputing anything, despite the floats not even being used in the shader yet!
If you comment out uint ii : SV_InstanceID; it works again.
So whats happening here!
Any explainations welcome :)
Any solutions even more welcome! Although I do want to know what I’m doing wrong, so I don’t go and do it again ;)

LitShere particles No worky (1.5 MB)

do you have this working lit sphere?

Not as a particle!
Its from the contributions page, I’ve successfully had it working with dx9 particles, but was trying to get it into the dx11 way…
The gourand works (ish!)

So thought I’d start from scratch and port matcap first…
While I was adding the code, I had the sphere attached to a constant dx11 shader, and all was going well-ish till I deleted the constant, and the model disapears again! Which isn’t expected behaviour!

The patch I’ve added demo’s this issue…

Shader editor issue (1.5 MB)

So, I’ve moved the Tangant and Binornmal initialisation to the main part of the shader, not in the vs_In, and this means the shader works and you have colour from the light map, but the normals don’t work, this could be because we have no normals in the model, the original patch uses a normals node to add them to the teapot.
Next make it a particle!

Almost there! (1.5 MB)

ok updated the particle-madness page with the shaders for Gourand Directional and LitSphere…