Panda effects cookbook

I’ve put together a sequence of models to show off panda’s new effects capabilities. There is a readme.txt file included that discusses how each effect is created within the .egg file itself.

This demo covers:

Normal maps
Glow maps
Bloom effect in general
Gloss maps
and combinations of the above.

I can’t wait until blending if fully supported with the new system-there’s lot of effects I want to put together like glow maps, normal maps and cubemaps- but that will have to wait.

Normal and glow should work fine together right now.

In time, cube maps will work too, but I haven’t done that yet.

wow that is cool maybe include this as a sample program?

PS. The bloom filter has a lot of parameters for tweaking it. It looks to me like you’re using the parameters from the glow filter sample program. I think you can probably get nicer results by tuning it a little.

@Josh- Normal and glow and gloss for that matter are working fine in combination. I guess I’m talking about being able to use the built-in cubemap again along with the above- perhaps not the same model but in the same scene. That way I can have the metallic look of cubemapping along with the effects here.

I’m sure there are probably tweeks to be made to how I set up the bloom effect. I haven’t found good information on this. any advice would be great.

@ Treeform

I put this together both to learn and as a demo- I think it would be great as a sample program. There should probably be more on-screen text describing what’s different with each model.

A fantastic sample!!!~ :laughing:

I am newbie.
Whould you please tell me how to create an ‘earthgloss.png’,
‘earthmod.png’ and ‘earthnormal.png’ from a native picture,‘earth.png’.

Was it created from Photoshop?
If it right.
Please tell me the method for each pictures.

Thank you. :open_mouth:

The cookbook.txt file should be able to explain all the coding needed for the effects and it sounds like you just want to know how to make the images.

First thing you need to know is that normally an image’s Alpha channel will tell how transparent each pixel is. Here Panda uses the alpha channel information on the image to denote places of higher gloss, or places of higher glow depending on how you set up the texture in the egg file.

So, now to the actual steps: (I used GIMP for everything)

Earthmod.png - on the image’s layer in the list of layers, right click- select “Add Layer Mask”, select “Layer’s alpha channel”. Then you will see the image next to a black or white box. Black will be places of zero alpha, white will be places of full alpha. Grey will be somewhere in between. For earthmod.png I selected just the landmass and then colored it all black in the alpha channel and colored the ocean all white.

Earthgloss.png was pretty much the same thing except that I put in some white noise on the alpha channel over the ocean and used a motion blur to try to make it look like waves.

Earthnormal.png- This was produced from a GIMP plug-in for creating normalmaps. see

I can do it now!!~

Thanks a lots mavasher. :wink:
My game will be more smart!!

I applied normal maps to my road.

A frame-rate down when the camera saw all part of the road.
I thinks my road is too long.

Is it possible to limit a distance of normal-map that will be rendered.
(in the same texture.)

Any idea?
Thank you!!~

Except changing the far distance of the camera, I don’t think so.
You can actually do something similar that would speed up far distance rendering, you can enable texture Mipmapping:
Scroll a bit down to see how.
You can also enable mipmapping in your .egg files instead of programatically, you’d have to read up eggSyntax.txt for that. It’s not hard, I use it myself a lot too. MipMaping really speeds up rendering and it even looks better.

hello ‘mavasher’.
I like this one :slight_smile:
And I have some problem here.
I use 3dsmax to export model and follow your instruction in README.
I wanna use your earthgloss.png to glow up my own shirt. (shirt.jpg)
so I change .egg

<Texture> Tex6815 {
  <Scalar> format { rgb }
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }

into this

<Texture> shirt.jpg {
  <Scalar> format { rgba }  
  <Scalar> wrapu { repeat } 
  <Scalar> wrapv { repeat } 
  <Scalar> minfilter { linear_mipmap_linear } 
  <Scalar> magfilter { linear } 
  <Scalar> envtype { modulate_gloss }  


And replace { Tex6815 } to { shirt.jpg }

When I run a game. Why I see your earth.png map to my shirt. (show gloss map normally)
I wanna see shirt.jpg gloss map with earthgloss.png.
help me.

(sorry for my English, I am Thai :blush: )

1 Like

You have replaced the referenced texture in your material so panda loads up the earth texture. You only need to copy the material settings to your material.

<Texture> Tex6815 {
  shirt.jpg // This is the image file applied to the material
  <Scalar> format { rgba } 
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }
  <Scalar> envtype { modulate_gloss } 


That would work with the original egg file you generated, if not just change the material name to the one in your TRef.