Author Topic: Smoke and dirt  (Read 2240 times)

Offline mbowen89

  • byte
  • *
  • Posts: 20
    • View Profile
Smoke and dirt
« 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:


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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12005
    • View Profile
    • http://www.jpct.net
Re: Smoke and dirt
« Reply #1 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?

Offline mbowen89

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Smoke and dirt
« Reply #2 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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12005
    • View Profile
    • http://www.jpct.net
Re: Smoke and dirt
« Reply #3 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?

Offline mbowen89

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Smoke and dirt
« Reply #4 on: January 07, 2013, 05:45:26 pm »


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"?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12005
    • View Profile
    • http://www.jpct.net
Re: Smoke and dirt
« Reply #5 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.

Offline mbowen89

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Smoke and dirt
« Reply #6 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12005
    • View Profile
    • http://www.jpct.net
Re: Smoke and dirt
« Reply #7 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... ???

Offline mbowen89

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Smoke and dirt
« Reply #8 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?
« Last Edit: January 08, 2013, 05:11:06 pm by mbowen89 »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Smoke and dirt
« Reply #9 on: January 08, 2013, 05:29:06 pm »
Use Texture.defaultToMipmapping(true)  ;)