Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Two textures for mesh / terrain

Author
Message
ale870
17
Years of Service
User Offline
Joined: 17th Jan 2007
Location:
Posted: 19th Jan 2009 02:01
Hello,

I simply need to load a mesh ".x" file, then apply a base texture (supertexture for the whole terrain) then I want to apply a detail-texture over. This is a similar approach used for advance terrains, but I want to work with meshes (objects).
I found several topics, but I cannot manage correctly blending, stages, supertexture (stage 0?) and detail textures (to be tiled over the mesh, and should NOT be stretched).

I made many tests but I got no valid result.

Now I'm using this code:


This is only a test, but I tried a lot of combinations for blending, set texture, etc...

Please help me!

--Alessandro
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 19th Jan 2009 03:01 Edited at: 19th Jan 2009 03:08
I can't remember where, but I know I remember a simple multi-texturing shader GG posted a while back in a thread and it did exactly what you want, in fact I used it for my terrains. I'll go look for it.

EDIT:

I found it! It's attached to my post. It's really simple to use, just use Set Object Effect, then use texture object to texture it with multiple layers:



If your detail texture appears stretched, use Scale Object Texture with stage 1--the stage of your detail texture--and scale it smaller so it tiles.

Attachments

Login to view attachments
ale870
17
Years of Service
User Offline
Joined: 17th Jan 2007
Location:
Posted: 19th Jan 2009 15:00
Thank you!
Can you give me a hint how to apply a shader "fx" in DBPro?

--Alessandro
ale870
17
Years of Service
User Offline
Joined: 17th Jan 2007
Location:
Posted: 19th Jan 2009 15:11
Sorry, I didn't see code snippet. My mistake.

Thank you!

--Alessandro
ale870
17
Years of Service
User Offline
Joined: 17th Jan 2007
Location:
Posted: 19th Jan 2009 15:24
Hello,
it seems that as soon as I give the command dbSetObjectEffect(terrainId, myEffect)

the game crash!

Can you give me some hints?

Thank you!

--Alessandro

Login to post a reply

Server time is: 2024-09-28 00:28:13
Your offset time is: 2024-09-28 00:28:13