Texture help, and other various questions.

Started by
1 comment, last by Whogie 19 years ago
Hello. I'm trying to learn to make 3D software with DirectX by making a space program. I make my models in Milkshape 3D, and I view the models in MeshViewer, and they don't look too bad. When I put it in my game, though, they don't look as good: Large picture. If you look inside the engine, it seems MeshViewer blurs my texture, which looks a lot better than seeing the individual pixels. How would I do this, myself? Is there a flag I should set? Also, if you look in the background on the game screenshot, you can see a field of stars. I did this by making a mesh sphere, and reversing all the faces so culling won't kill it. Then I put a rediculously large texture on it, so the stars don't look pixelated, too (4096x4096). I noticed in another program, which I did not have the source to, the star texture was small, and it seem to have repeated over and over. How could I repeat a texture over and over on a mesh, myself? Is it possible to have an object not affected by light sources, and be 100% bright? This could help me make my sun, or fire effects, for example. Thank you very much for your time.
Advertisement
Quote:Original post by Whogie
If you look inside the engine, it seems MeshViewer blurs my texture, which looks a lot better than seeing the individual pixels. How would I do this, myself? Is there a flag I should set?

Mip maps and texture filtering. You need to create a chain of mip maps for each texture. Then set the 3 texture filters (Device::SetSamplerState() with D3DSAMP_MAGFILTER, D3DSAMP_MINFILTER, and D3DSAMP_MIPFILTER). You'll probably want to set these to D3DTEXF_LINEAR to start off. You only need to call this method once for each filter after you set up the device. The mip map creation depends on how you load in your textures. D3DX can do this for you if you pass the number of levels in the load function call.

Quote:Original post by Whogie
Also, if you look in the background on the game screenshot, you can see a field of stars. I did this by making a mesh sphere, and reversing all the faces so culling won't kill it. Then I put a rediculously large texture on it, so the stars don't look pixelated, too (4096x4096). I noticed in another program, which I did not have the source to, the star texture was small, and it seem to have repeated over and over. How could I repeat a texture over and over on a mesh, myself?

You can tile textures on polys. Just set the texture coordinates to really high numbers. For example, 0.0 to 1.0 means the texture isn't tiled, where 0.0 to 2.0 means the texture is tiled twice. If you mean in a modeling program, then it depends on the program (I'm not sure how this is done in Milkshape).

Quote:Original post by Whogie
Is it possible to have an object not affected by light sources, and be 100% bright? This could help me make my sun, or fire effects, for example.

Ambience. Set the material ambience color to match your sun's color on the call to Device::SetMaterial(). Ambience means the object is always lit that color. No directions or distances have any effect.
That was very helpful. Thank you very much.

This topic is closed to new replies.

Advertisement