Building Textures
Building Textures
Building Textures
Building Textures
Building Textures
Building Textures Building Textures Building Textures Building Textures Building Textures Building Textures Building Textures Building Textures
Building Textures Building Textures
Building Textures
Go Back  Xtreme Visual Basic Talk > > > > Building Textures


Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2006, 06:05 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default Building Textures


I'm looking for a good way to combine multiple textures into one large texture for my terrain. Eventually I'd like to have overlapping textures and blending and all that goodness, but for now all I want to do is take one relatively small bitmap, like grass, and pretty much tile it over a mesh. Is there an easy way to do that, like some texture setting? Or some trick to copy one texture onto another over an over (kind of like creating a 2D side scroller)? I am using DX9, and frankly Microsoft could have done a little better on their SDK.
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
  #2  
Old 05-05-2006, 07:11 PM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

You tile it by manipulating the U and V texture coordinates in your terrains vertices.

U and V denote the texture X and Y position at that vertex and are considered to range from 0.0 ( = left or top edge of texture ) to 1.0 ( = right or bottom edge of texture )

With texture wrapping enabled (its on by default I believe) you can use values outside of 0.0 to 1.0, which allows you to tile the texture across multiple vertices.

If your terrain is modeled in a 3rd party modeler then it probably already has set up texture coordinates that range from 0.0 to 1.0 across the entire terrain. To make the texture "smaller" (and thus tile it) you can multiply every texture coordinate by a constant (U*16 and V*16 would give you 16 texture tiles across the terrain) but only when wrapping is enabled.
Reply With Quote
  #3  
Old 05-06-2006, 09:38 AM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default

Interesting, I didn't know that. That will work if I want to just use one texture to tile my terrain, but what if I want to use multiple textures, like some dirt paths, or a shoreline with sand? Would it be better to combine the textures somehow before applying them, or should I apply one base texture to the entire thing and then just lay additional textures on top of that, blending them into the base?
Btw, the terrain is generated dynamicly using a class I wrote. You pass in the number of "tiles" in the x and z directions and how big you want each on to be and it creates a flat terrain, so I am responsible for the lighting and texture coordinates and all that.
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
  #4  
Old 05-06-2006, 06:17 PM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

The easiest way is to use one big texture but obviously that has severe limits (most people have hardware that only suports up to 2048x2048 textures)

The hardest way is often called "splatting" but I am definately no expert on it but here is a tutorial (not for VB.NET unfortunately.. but the methodology is the same) http://www.gamedev.net/columns/hardcore/splatting/

There is also the option of using pixel shaders and either doing your own texture blending or even better, using procedural textures (perhaps based on perlin noise) that would take in coefficients for each material and spit out a color value. This is something I can explain how to do in a software rendering sense, but not in the GPU/hardware sense since I really am not an expert on D3D.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Building Textures
Building Textures
Building Textures Building Textures
Building Textures
Building Textures
Building Textures Building Textures Building Textures Building Textures Building Textures Building Textures Building Textures
Building Textures
Building Textures
 
Building Textures
Building Textures
 
-->