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.

DarkBASIC Professional Discussion / Terrain texture ?

Author
Message
Star Vitebsk
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 12th Jun 2010 22:06 Edited at: 12th Jun 2010 22:39
I can not texturing the entire facility.
help.

convert object fvf tob, 338
set object texture tob,0,0
texture object tob,0,31
texture object tob,1,32
texture object tob,2,33
texture object tob,3,34
texture object tob,4,35
texture object tob,5,36
texture object tob,6,37
texture object tob,7,38
set object effect tob,1

Download programm
[href]https://forumfiles.thegamecreators.com/download/2030678
[/href]




[email protected]
mobil MTS: +375 29 895-98-82
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 13th Jun 2010 10:10 Edited at: 13th Jun 2010 10:10
Quick look through your code shows that your using a shader for your multi texturing,is it Green Gandalfs?.
Only problem with the code i can see is the way you are setting up the UV co-ordinates so that each tile is using the whole of the texture rather than spreading it out over the whole terrain.
I tend to define 2 constants uc# an uv# as 1.0/world size x and the world size z, and then set them as u# = uc# * vertex position x and v# = vc# * vertex position z,hope this helps.
If you want i cant post up some code to show you how i do it or take a look at the thread about terrain painting,the code snippet near the bottom (paul5147) is mine.
Star Vitebsk
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 13th Jun 2010 16:22 Edited at: 13th Jun 2010 16:32
paul5147 Please is more detailed.

[email protected]
mobil MTS: +375 29 895-98-82
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 13th Jun 2010 17:37 Edited at: 13th Jun 2010 17:38
Quick code snippet of how to stretch to uv values over the whole terrain.
if you use the fixed values of 0's and 1's the way you are doing it it will tile the texture over the terrain so it will apear multiple times.
To apply the texture over the whole terrain you need to sub devide the uv values over the whole object.

0.0/0.0 0.5/0.0 1.0/0.0


0.0/0.5 0.5/0.5 1.0/0.5


0.0/1.0 0.5/1.0 1.0/1.0



hope this helps.
Star Vitebsk
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 13th Jun 2010 18:03
Now I understand how it should properly do.

paul5147 Thank you !

[email protected]
mobil MTS: +375 29 895-98-82
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 13th Jun 2010 18:07
Glad to be of help Star.

Login to post a reply

Server time is: 2026-07-25 16:21:06
Your offset time is: 2026-07-25 16:21:06