Jump to content
  • Advertisement
Sign in to follow this  
Whogie

Texture help, and other various questions.

This topic is 4950 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!