Shaders on PArticles?

Posted By: Rackscha

Shaders on PArticles? - 01/14/13 22:02

Ok, for an obvious reason, i did something wrong.

I assigned a material to my particle. The material includes a shader which just outputs a single collor. But for some reason, this shader is ignored. The particles still appears normal(as with or without bmap and predefined colors)

Anyone an idea?
Posted By: Superku

Re: Shaders on PArticles? - 01/14/13 22:16

AFAIK only decals support shaders.
You can render the particles for postprocessing effects, though.
Posted By: Rackscha

Re: Shaders on PArticles? - 01/14/13 22:39

Ok, thats exactly what i want. How do i render them for postprocessing?
Creating a second view which just renders particles(and uses a material for all rendered elements on this scene)?

Iam a bit slow tonight :|
Posted By: Superku

Re: Shaders on PArticles? - 01/14/13 23:52

Well you want to use that for your water particles, right? Shaders on particles simply do not work, you would need to use sprites instead. However, you can render only the particles in a second view, use the result as a mask, calculate contours and the like (if necessary) and apply your water effect on the scene/ appropriate parts of the mask.
Posted By: Rackscha

Re: Shaders on PArticles? - 01/15/13 09:18

ou thats a problem.

I need to render particles as sphere point sprites to a depthtexture for "Smoothed Particle Hydrodynamics".



In works like this:
- Render particles to depthmap as sphere point sprites
- Smooth depthtexture
- Calculate Normals from Depth
- Render Gouradshaded(skipping densitity texture here, as this is the first simple goal i want to archieve)



This Document highlights these single steps:
https://developer.nvidia.com/content/fluid-simulation-alice-madness-returns

But sprites are much much slower frown (or am i mmissing something?)
Posted By: Rackscha

Re: Shaders on PArticles? - 01/15/13 15:15

One additional question: why does the PARTICLE struct contain a material property, if the material is unused?
Posted By: Superku

Re: Shaders on PArticles? - 01/15/13 19:50

Decals and regular particles share the same struct, that's why there is a material and an angle attribute.
I suggest you try to create a 2D simulation first (no depth required), using sprites (unlit, passable) or a more rough approach using particles.
Good luck!
Posted By: Rackscha

Re: Shaders on PArticles? - 01/15/13 20:16

@Superku: I dont think i can limit the PhysX Fluidsystem to 2 axes. So it always expands to 3D. And when i use particles, i dont have a Depthvalue per pixel(spherical), which removes the option to render it as volume frown
Posted By: rojart

Re: Shaders on PArticles? - 01/15/13 20:28

Hi Rackscha!
If you need something like this, PN me.

© 2024 lite-C Forums