DynamicGrass?

Blitz3D Forums/Blitz3D Programming/DynamicGrass?

Guy Fawkes(Posted 2009) [#1]
hello guys. i have a simple question.

can someone please tell me how i can change my texture scale or w/e so it doesnt look like all hillbilly-squares like in the picture u see below?



i would be greatful for the help!

PLEASE NOTE this is NOT my work so I'm not taking credit for anything but the hill texture and the blue flower particle texture. i found this on google code, and edited it.

here is a link to the zip file containing the source and the executable. along w/ all needed files :)

http://www.mediafire.com/download.php?thodnnwzkwa

thanks alot guys!


Yasha(Posted 2009) [#2]
Check the documentation on the ScaleTexture command. Just looking at the screenshot of your code rather than downloading it, try adding the line:
ScaleTexture terrain_tex,100,100

at the end of the block where you load and apply the texture, and see what happens.

Your texture's also not going to tile very well no matter what scale it is - I recommend taking a look in your Blitz3D\Tools folder at John J's Texture Studio, which can fix the edges a bit so it tiles better.


Naughty Alien(Posted 2009) [#3]
..use of seamless texture should fix problem..current texture is not seamless and thats why its look like as shown on pic. Scaling up given texture over such big terrain will make results worse on other way (serious loss of details)..as i said..tileable seamless texture will do just fine..


Guy Fawkes(Posted 2009) [#4]
is there any generator i can use that will make the edges seamless?


Guy Fawkes(Posted 2009) [#5]
also, how can i make it so that it scales my texture accordingly, so like for instance if say im looking straight down, it will make the texture smaller, but if i start to lookup, it will make the texture bigger both without being noticed?

code:

;If looking straight ahead or up else looking down
If xrotation# >= 40.0 Then scaletexture terrain_tex, 0.144, 0.144 : Else scaletexture terrain_tex, 6.144, 6.144


thanks!


Yasha(Posted 2009) [#6]
is there any generator i can use that will make the edges seamless?


This is what John J's Texture Studio does, as mentioned above...

You could also use SSwift's Seamless Texture Generator, which is far superior but does cost money.


Guy Fawkes(Posted 2009) [#7]
thanks yasha

can someone show me how to fix that if statement? im SO close to getting it. but i cant quite put my finger on it.


jfk EO-11110(Posted 2009) [#8]
There is also some code in the archives, by elias_t, to make a texture seamless. Personally I prefere to do this manually in photoshop: create 4 clone layers, move them 50% of the diameter towards the 4 corners, then flatten them. keep one orignial layer on the bottom and then erase the center of the flattened layer with a very smooth eraser. Anyway.

Not sure if it's really a good idea to alter the texturescaling depending on the pitch angle of the camera. There are some other, promising methods for dealing with grass - I mean, gamedesign-wise. Also in the code archives. (Not talking about the one by me, cause it may be too slow).

You may however test your idea, try EntityPitch(camera) and multiply it by something that results in range that is useful for ScaleTexture.


Guy Fawkes(Posted 2009) [#9]
right. i know. however, its not the formula i need. its knowing which # i need to tell it, when looking up or down. i mean, i have to keep the texture change hidden from view. so that way it appears as the perfect texture no matter what.


jfk EO-11110(Posted 2009) [#10]
But what are you gonna do when the player first looks down and then next he looks straight forward? He doesn't look away between the two angles. Well, maybe I don't understand the problem.


Guy Fawkes(Posted 2009) [#11]
ok. like for instance. if the player is looking straight down at the texture, it will resize smaller, but if the player is NOT looking at the ground, it will resize bigger.


Drak(Posted 2009) [#12]
What about when the player is changing from looking at the ground, to looking forward. If you moved the camera at a steady pace from the ground to forward, it would look like the ground was moving... because actually the texture WOULD be moving as it is scaled up.


Drak(Posted 2009) [#13]
I just thought of something. What is the reason for scaling a grass texture UP if it looks fine already? If it looks good while looking straight down on it, it will look equally good while looking forward across it. Is there a specific reason it would even need to be scaled up?


Guy Fawkes(Posted 2009) [#14]
because it doesnt look fine if ur on the ground, and looking at a crappy big texture..


jfk EO-11110(Posted 2009) [#15]
But there are other ways to solve this issue. First: A better texture. A Grass Texture (even when already perfectly tiling) shouldn't have significant irregularities on it (eg. light or dark spots), they appear as pattern when scaled up. So you have to work on your grass texture and repeatedly check it in a 3D program, until it's looking good near and far.

And then add some stuff on the field. It will reduce the pattern artefacts greatly!


Vorderman(Posted 2009) [#16]
If you want nice tiling grass textures, go to this website:

http://www.cgtextures.com/

You need to register for free, then go into the Nature section, then the Grass subsection, and you find ready-made tiling 640x640 grass textures, all of which are very nice.


Ross C(Posted 2009) [#17]
It's a bad idea to dynamically scale a texture. Your best letting mipmapping do it's thing. Get the texture how you want it when your looking down at it and let the automatic mipmapping do its thing. It will reduce the resolution of the texture, the further away it is.