Racing game help

Just wanting to ask

What’s your poly budget for your cars and the track?
Texture dimensions?
What shaders you used?

Thanks in advance.

Here’s my experiences:

For my games I tend to target roughly 1.5-2k polys for a car, but that heavily depends on the game and on your setup as well as your target audience. In my latest racer I have up to 12 cars driving around, means 12x 2k polys.

The track I’m usualy trying to weight between draw calls and poly count to get into an area where GMA chipset is still able to render that game good. I found a good setup for me with roughly 100-150k polys while staying around 150-200 draw calls max. to let the game run smooth on a GMA chipset computer. I have code that automatically upscales then to faster computers by enabling features like bump mapping etc.
For Hard Rock Racing if all features are enabled on a fast computer, it goes up to 1000 draw calls easily.

Texture dimensions is a funny thing. I tried to have the cars textures quite high (1024x) - or better, all that is close to the camera in higher res texures and distance textures a bit lower, like 512x or 256x textures. As said, depends on your setup. In my case it worked fine that way but I targeted a binary size of the webplayer of 5 megabytes and had to cut somewhere. :slight_smile:

As I am not a shader guy (but wanting to learn it “one day”), I stick to the shaders coming with Unity or from the Unify wiki.

Hope that helps.
Martin

Are we still talking about a racing game for the iphone development here? :shock:

Haha, DOOOOOH! I accidentially overlooked the category. OUCH! :slight_smile:

No, of course iPhone is different. For Big Fun Racing is was trying to keep the limit around 25-30 drawcalls and around 1k-2k polys max.

Had help(forum, human) with this one. This let’s you change the tint and choose which parts of the car gets the shiny effect using a single texture. Can this still be optimized? Thanks in advance and thanks Martin for the tips!

opaque - no shine, not affected by tint
semi-transparent - shine, not affected by tint
transparent - shine, affected by tint

Shader "iPhone/CarPaint" 
{ 
	Properties 
	{ 
 	  _TintColor ("Tint Color", Color) = (1,1,1,1)
 	  _Color ("Ambient Color", Color) = (1,1,1,1)
 	  _SpecColor ("Specular Color", Color) = (1,1,1,1)
 	  _Shininess ("Shininess", Range(0, 1)) = 0.5
 	  _MainTex ("Base (RGB) Mask (A)", 2D) = "white"
 	  _EnvMap ("EnvMap", 2D) = "" { TexGen SphereMap}
	} 

	SubShader 
	{ 	
		Lighting On
		SeparateSpecular On
	
		Pass
		{
			Material 
			{ 
        		Diffuse [_Color]
        		Shininess [_Shininess]
        		Specular [_SpecColor]
         } 
		
			SetTexture [_EnvMap]
			{
				Combine texture * primary
	      }	    
		}

   	Pass 
   	{         
   	   Blend One OneMinusSrcAlpha   	  
   	
      	SetTexture [_MainTex] 
      	{ 
         	ConstantColor [_TintColor] 
         	Combine constant + texture alpha
      	}
       
      	SetTexture [_MainTex] 
      	{ 
        	Combine previous * texture
      	} 
      }
   }
}

I dont know much about shaders but it looks awesome :smile:

Can I see a screenie of your “awesome” shader :stuck_out_tongue:

Here they are

259446--9334--$pic1_213.png
259446--9335--$pic2_391.png

No purple? :stuck_out_tongue:

Thanks for the screenies.

Sorry for this dumb question :shock:

How do I make an EnvMap (Environment Map) for this shader. Google can’t provide me with an usable tutorial. :wink:

lesguerra

Can you post the example textures of the above image?

Thanks,

Peter.

sphere maps aren’t exactly trivial to create but generally you should find some information on sphere maps