Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Texture Mapping and Quality Loss
Topic Started: Sep 29 2012, 09:11 PM (110 Views)
mardyart
Advanced Member
[ *  *  * ]
I have a few questions and notes about the textures each model uses and the way it is rendered in U3d.

For the example we will use an earth model. When the model was created in 3ds max, it had a HQ earth map(over 10k px) applied to it. It was then exported preserving max's texture coords to "models/earth.3ds" and loaded from that location by U3d in the model object. When the program was run, the texture was rendered on the model without using LoadTexture() in the control object. However the program shows an error if the texture is not available in the texture path and aborts.

Another model was created with no texture applied, max's texture coords negated and exported to the models path, as the first.
In the control object the texture was loaded: LoadTexture("gfx/earthmap.jpg", 10)
In the model object the texture was applied: texture=10
When the program was run the model was blank.

What is happening here? And do we need the LoadTexture() function at all?

On another note, with the first model, although the texture is of high resolution it is not rendering as crisp and clear as I've seen in the tech demo or some other examples.
In the control object the height map was loaded: LoadHeightMap(11, "gfx/earthbump.jpg", 2)
In the model object the texture was applied: ApplyParallaxAndBumpMapping(GetMaterialIndex("01 - Default"), 11, 0.02, light_point)
When the program was run, it shows the bump effect fine as it should but the texture quality is still very low.

Can anybody shed some light on what could be happening here?

I look forward to your comments.
There are 10 kinds of people in the world: Those who understand binary and those who don't.
Offline Profile Quote Post Goto Top
 
alexmach1
Member Avatar
Graphics addict
[ *  *  *  *  *  * ]
texture is a variable used only on primitives. for models, you use:
SetMaterialStageTexture(material index, stage, texture index)

for example;
SetMaterialStageTexture(0,0,10)

this sets the first material slot's diffuse to the texture '10'

Offline Profile Quote Post Goto Top
 
mardyart
Advanced Member
[ *  *  * ]
Thanks for the clarification. I guess I'm a little confused because I've been looking at the collision example, the one with the wolfenstein character. That wolf uses an md2 model and is textured using the 'LoadTexture()' function and 'texture' variable. Am I correct in thinking I would load the texture in the control object and set the texture stage for my model in the create event of the model object?
There are 10 kinds of people in the world: Those who understand binary and those who don't.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply