www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: mbowen89 on December 28, 2012, 06:17:44 pm

Title: Smoke and dirt
Post by: mbowen89 on December 28, 2012, 06:17:44 pm
Ok, I know this has been somewhat discussed before, but I'm really really wanting to figure this out.

I know that a "particle" system would be the easiest and most simple approach, and the only one discussed, but I have no idea how to generate the smoke I specifically need in that manner. I need thick black exhaust smoke, and LOTS of it!

Example:
(http://bloximages.chicago2.vip.townnews.com/emissourian.com/content/tncms/assets/v3/editorial/8/5f/85f2711a-c356-11e0-8296-001cc4c03286/4e428aa84b4e9.image.jpg)

I've used a particle system before trying this, but it just looks pretty cartoony with puffs of smoke coming up, and I used hundreds.

Any ideas? And any ideas about making dirt from the tires spinning come out?

Thanks!
Title: Re: Smoke and dirt
Post by: EgonOlsen on December 28, 2012, 10:00:59 pm
A particle system with a good smoke texture should actually do the trick. The same applies to the dirt. Which texture did you use for the smoke?
Title: Re: Smoke and dirt
Post by: mbowen89 on December 29, 2012, 06:43:14 am
I used some smoke blob I made, came from exhaust and went up and got larger. Tried using 100 particles but still looked cartoony. I don't understand how I would make it look thick and black at stack and then turn into a big rolling poofy cloud.

Do I need to use billboarding? I have different camera angles.

Thanks for the help!
Title: Re: Smoke and dirt
Post by: EgonOlsen on December 29, 2012, 09:08:05 pm
Yes, some billboarded quads or single triangles with a good texture should actually do the trick. Do you have a screen shot of what you already have?
Title: Re: Smoke and dirt
Post by: mbowen89 on January 07, 2013, 05:45:26 pm
(https://lh3.ggpht.com/JilODT7ytMqUnxAvzQ_xJjKPcEjBISSlFQJ2N9eRNwsqsBujKkKZEsoCcFwc3OnDRg=h230)

Got it working enough for me... and actually no moving parts, just changing transparency levels!

Hey, I have always wondered this... is there a way to change a materials color after it's been loaded in?

For example, if I make a truck and its main body color is "red" and the material name is "truck_body"... this gets loaded in and set when I load the 3DS file in with jPCT.

Is there a way to edit the color value of "truck_body" material from its default color of "red"?
Title: Re: Smoke and dirt
Post by: EgonOlsen on January 07, 2013, 08:39:51 pm
What is read from the file as a color is actually rendered as a colored texture. I.e. jPCT-AE creates a small colored texture with that color. What you can do is to replace this texture in the TextureManager with some other colored texture (or any other one...). The name of the texture to replace depends on the color. Have a look at the log output, you should be able to find it somewhere.

BTW: Why aren't you using mip-mapping for your textures? This would improve the textures in the distance and remove this texture aliasing that you experience.
Title: Re: Smoke and dirt
Post by: mbowen89 on January 07, 2013, 10:00:12 pm
What texture aliasing are you talking about?

I'll take a look at the color texture thing, thanks.
Title: Re: Smoke and dirt
Post by: EgonOlsen on January 07, 2013, 10:06:40 pm
That grainy and fuzzy look in the distance, the flickering pixels. Try with mip-mapping enabled and you should be able to spot the difference.

BTW: I would like to add your games to the projects page, if you don't mind... ???
Title: Re: Smoke and dirt
Post by: mbowen89 on January 08, 2013, 04:52:19 pm
Sounds good to me, they are doing pretty well!

Am I being stupid or what... I can't find the config for mipmapping?!?

Searching the forum I see people using this sometimes: Config.glMipmap = true; but I don't see that in the javadoc for Android.

Maybe Config.glTrilinear is what I want?
Title: Re: Smoke and dirt
Post by: Thomas. on January 08, 2013, 05:29:06 pm
Use Texture.defaultToMipmapping(true)  ;)