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 / Changing parts of the terrain texture in real time

Author
Message
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 29th Sep 2012 10:33
Any idea on how they achieve this?

http://www.youtube.com/watch?v=1yPacnBrZRs

1) Change of the visible texture through layer transparency manipulation?

2) Painting on the terrain texture?

3) Decals splatting?

I will appreciate your comments.
Thanks in advance

Scorpyo
david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 29th Sep 2012 22:04
I am not exactly sure how they are doing it but I would think that layer transparency is probably the best bet, and the fastest way to do it.

Painting on the texture would probably be to slow as you would have to keep locking and unlocking the surface.

Decal splatting if you were using plains would eventually eat up the frame speed.

This them puts us back into changing the effect area based upon a transparecy value. But in that video it looks like the are just switching between two textures, and not even using any transparency. If it is plowed then texture 2 if not texure 1. Maybe as simple as that.

It could also be that its not a giant "plane" and rather its a grid of plains that they are just swaping textures on. That is probably the simplest way. Why not?
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 30th Sep 2012 00:16
think Blitzworks Terrain can do this...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 30th Sep 2012 09:35
Thanks for the comments so far.

Layer transparency seems to be the best guess.
The idea about premade planes is also rather cool and it can be handy in some situations.
I'm trying to replicate an agricultural scenario (see pic) and I am missing this specific issue.

cheers
Scorpyo
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 30th Sep 2012 09:44
By the way,
How come that the rendering in the modeler is so much better than DBP's at run time?
david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 30th Sep 2012 12:42
how do you mean? such as yours looks like a ps2 or xbox original and thiers looks more modern?

I guess that all depends upon how you are "rendering" your objects. Just default by DBP or are you using shaders over the entire thing. And how are you doing the terrain? Fixed Function blending or shader based. Maybe you are using transparent layering so of the grass. IDK without further information about this stuff
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 30th Sep 2012 17:46
It seems to me that the objects have better visual quality in my modeler.(pic attached)
I'm not appling any effect (bump mapping,etc.)neither in DBP nor in the modeler.
Probably I should tweak the lighting in DBP
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 30th Sep 2012 18:09
Quote: "It seems to me that the objects have better visual quality in my modeler.(pic attached)"

DBP uses an ambient light that can wash out textures if no other effects are used. If you use a simple per-pixel lighting shader, it should look a lot better.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Oct 2012 13:23
I'd try the blend mapping commands with a black and white image that gives an L-shaped edge between the two textures. Then adjust the UV coordinates for the L-shaped image as it follows the plough. You'd need an extra set of UV coords for this and probably the more recent version of the blend mapping command illustrated in the "LerpingTextures" snippet in your DBPro Projects/Snippets folder.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 1st Oct 2012 21:19
Thanks all for all the good advices and directions.
I'll look into that.
I tried by splatting textured plains on top of the terrain as the plough goes forward,scrolling the texture at plough position in order to give the idea of motion and also minimize the repeated patterns, which sort of works right, but you may end up with too many (more polygons) in the end as there are many fields to be done.
The good part is that you can take them away at will as a new season starts and even leave the ploughing half done for later completion.
Got to experiment more.
Cheers all
Scorpyo

Login to post a reply

Server time is: 2026-07-08 14:10:40
Your offset time is: 2026-07-08 14:10:40