Rendering Sprites with Mantra?

   9653   9   4
User Avatar
Member
252 posts
Joined: July 2005
Offline
I have a sprite setup that displays in my GL window somewhat correctly, but I have a special SHOP to do some different processing on the Sprites, yet I can't find a way to render a sprite with Mantra- I can only show it in my OpenGL window. Is there a way to render a Sprite system with Mantra?

Also, does anyone know why my texture map with nice soft Alpha edges show up like a cutout with a hard edge following the alpha in the GL window despite turning on all the GL Transparency options? The Alpha is being used, but it is like there is a clamp or smoothstep to make a hard change at some value. My texture is a .tga and is premultiplied, but I don't know if that is an issue. (Would it do better as a .rat?)

Thanks,
Craig
User Avatar
Member
36 posts
Joined: July 2005
Offline
To render sprites in Mantra.-

Go into the render tab of Geometry SOP. Change the Geometry -> ‘render as is“ to ”procedural". Open the dialog below for the mantra Procedural with the little ’+' button. choose ‘sprites from the pulldown and Accept.

Just to confirm. you can switch, if you want, how the GL viewport viewport displays the particles. Press the ’D' key. Click on the ‘Particles’ tab. Change ‘Display particles as’

Your othe issue with the alpha. Maybe this is an issue with the .tga format. or even a GFXcard issue.
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Try adding both a Cd and an Alpha attribute using the color POP. This will ensure that alpha blending is done in the viewport. Without these attributes it is only performing an alpha test. The existence of the attributes will be enough, so you can just set the colour to 1,1,1 and the alpha to 1.
User Avatar
Member
252 posts
Joined: July 2005
Offline
This worked great! Both suggestions were very helpful!

Now if I can just get Side Effects to integrate HLSL (or GLSL) programmable shaders in the Viewport, these sprites would be really useful!

Thanks,
Craig
User Avatar
Member
252 posts
Joined: July 2005
Offline
Furthermore, what is really cool about your adding the Color POP suggestion Ondrej, is that the Color and Alpha act as MULTIPLIERS for what you see in the GL View, so you can tint your sprites or make them more transparent.

You can even animate their transparency with something like 1-$LIFE in their Alpha!

Ya learn something new everyday…

Thanks,
Craig
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Houdini is cool that way!
User Avatar
Member
56 posts
Joined: March 2006
Offline
To bring an old thread back to life, the alpha=0 regions of my sprites correctly show up as transparent in OpenGL (thanks to the advice above ;-)) but are solid black when rendered with mantra. Any suggestions on how to remedy this?
User Avatar
Member
1390 posts
Joined: July 2005
Offline
alpha does not equal oppacity… and the oppacity does matter for mantra when it establishes sprite's transparancy, if Im right.


cheers,
sy.
User Avatar
Member
7025 posts
Joined: July 2005
Offline
You need to use a SHOP like Supermaterial that will pick up the attributes. you also need to make sure to pass the attributes to the procedural that is applied to the Object.

Cheers,

Peter B

futnuh
To bring an old thread back to life, the alpha=0 regions of my sprites correctly show up as transparent in OpenGL (thanks to the advice above ;-)) but are solid black when rendered with mantra. Any suggestions on how to remedy this?
User Avatar
Member
56 posts
Joined: March 2006
Offline
Thanks for the tips guys.

pbowmar
You need to use a SHOP like Supermaterial that will pick up the attributes. you also need to make sure to pass the attributes to the procedural that is applied to the Object.

I have an object that contains a simple Popnet. In the object's render tab, I have geometry set to ‘procedural’ and mantra procedure set to ‘sprite’. For the test SHOP (applied in the popnet via a Sprite POP), I am using a built-in VEX Super Material with the diffmap pointing to my 4-channel .rat image (C + A). I thought this would do it but I'm still seeing black in the transparent regions of the map.

Having just watched the 3DBuzz VTM on writing a sprite shader with VOPs (as discussed in this thread, http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=4870&highlight=sprite [sidefx.com]), I wonder if I need to write my own shader? Or should it be possible with a supermat?

Cheers,
Darran.
  • Quick Links