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 / Saving a BlitzTerrain as X?

Author
Message
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Aug 2011 16:49
Quote: "Yes, I did

It's at the link I posted above "

Great. Now try to be patient and/or keep trying...

Mugen Wizardry
User Banned
Posted: 15th Aug 2011 16:50
Will do

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 17th Aug 2011 19:08 Edited at: 17th Aug 2011 19:13
Hi all. I just bought the full version of BlitzWerks Terrain, and am loving it. The ONLY problem is, when I go to texture my terrain model, for some reason, it repeats the same size as the face it is on's texture in the are of the face, for each face, thus causing MASSIVE problems with texturing.

How can I CORRECTLY save this built BlitzTerrain model, WHILE texturing the correct stages with the correct textures?

Here's my code so far:



It is above my main loop

Thank You!

EDIT: Attached, is a screenshot of what's going on

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Aug 2011 21:04 Edited at: 17th Aug 2011 21:27
Tried scaling the object texture?

On second thoughts, I think there's something wrong with the UV's here, maybe scaling won't help.

Mugen Wizardry
User Banned
Posted: 17th Aug 2011 23:05
How is there something wrong with the UVs? oO I simply used texture object obj, 1, img x)

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Aug 2011 23:05
You are creating separate terrain objects, saving them, then reloading them and texturing them with the full terrain texture.

You will need to separate the texture into the same number of pieces that you've separated the terrain into. Then texture each object with it's correct texture piece.

Mugen Wizardry
User Banned
Posted: 17th Aug 2011 23:06
how would i do that? o.o

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Aug 2011 23:09
You could use the vertexdata commands to change the UVs of the object, and then you could use the same texture for each object.

Mugen Wizardry
User Banned
Posted: 17th Aug 2011 23:20
how? ive never really used the vertexdata commands before like this.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 17th Aug 2011 23:55
Here's what I have so far. Problem is, it doesn't save all of the terrain detail....



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 18th Aug 2011 00:57
I THOUGHT everything was correct. :/ But apparently not, since I can't get it to stage my detail map WITH my texture already ON my model

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Aug 2011 05:27
First,

There is a link at the lower left corner of each of your posts.

It's called EDIT POST.

Use that instead of constantly making a new post every 20 minutes. This thread now has 5 pages, and it's only 3 days old, and YOU are the almost the only poster in it.

Second,

You have everything in front of you to make this work. Stop relying on code snippets here and there from others and work it out. You'll learn a lot more by finding out how it works on your own then you ever will if we are constantly guiding you through it every step of the way.

From the looks of it you are nearly there. So here's a hint. To solve the texturing problem, look at my Endless Terrain Demo code, and see what I did with the textures there.

Mugen Wizardry
User Banned
Posted: 18th Aug 2011 15:53
I just looked at your demo, and all's you do is texture it at stage 0. I need more than ONE texture.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Aug 2011 18:56
Keep looking. Look at what I do with the textures just after they are loaded.

Mugen Wizardry
User Banned
Posted: 19th Aug 2011 03:12
I still don't know where you want me to look. -.-

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 20th Aug 2011 02:20
Ok, you paste it to the screen. So what?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Aug 2011 04:42
Ok, you are looking in the right place.

Examine that code and see if you can figure out what it does.
Notice the size of the image that's being loaded, where it's being pasted, and the size of the image that's being grabbed...

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 15:39 Edited at: 20th Aug 2011 15:39
KISTech, I'm tired of playing games. Either teach me, or don't.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Aug 2011 18:03
Believe it or not, I AM teaching you. I promise, the code you need is right there.

The image being loaded is 4096 x 4096, it's being pasted to a 256 x 256 bitmap with a different offset between each GET IMAGE command.

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 18:10
and that's supposed to help how? a longer explanation goes a LONG way.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Aug 2011 18:46
I'm trying to teach, but just giving you everything already written isn't going to teach anything.

Your current problem is that you are texturing each terrain piece with the whole terrain texture. You need to break the texture up into the same size pieces (which I mentioned in the other thread). I'm trying to show you that you already have the code in front of you to do that.

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 18:48
explanation of EXACTLY the way your code works, would DEFINITELY go a LONG way in that case then.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Aug 2011 20:02
It's actually relatively simple. If you aren't able to figure it out, then coding may not be your thing.

After all, in my previous response I told you exactly what it's doing. Not in detail, but if you understand the coding language you should be able to understand what the code is doing.

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 20:08
Would you stop giving me problems and teach me like a TEACHER? I'm not gonna let ANYONE tell me coding is not for me. So go ahead, throw everything at me. I'm all ears.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Aug 2011 20:55
The code is right there in front of you. All you have to do is follow the logic and work it out.

That's how every programming teacher I've ever had taught me.

At this point I've done everything I can short of writing the code for you, and I'm not going to do that.

- You know you need to break up the textures to match the number of terrain pieces
- You know the code I pointed you towards does exactly that

It's up to you now to figure out how to use that knowledge.

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 21:16 Edited at: 20th Aug 2011 21:27
here's the thing. you're still not teaching me right. ALL teachers give their students NOTES first. So they can study them. Looking at your code, you don't include (in the texture splitting part) ANY notes such as "do this using this to split it up into this". etc...
EDIT: PLUS, where, ANYWHERE IN this picture, do you see a detail map? -.- that's the WHOLE point of this tutorial, is to use the texturemap, and the detail map together, split up by tiles.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Aug 2011 23:29
Quote: "ALL teachers give their students NOTES first. So they can study them. Looking at your code, you don't include (in the texture splitting part) ANY notes such as "do this using this to split it up into this". etc..."

You have 5 pages of notes now MW and KISTech really has given you enough to work it out yourself. There really is a LOT of information here in this thread, specifically for your problem.

I think it's time for you to read through these notes again particularly the last few by KT and just see if you can't work it out.

It's widely expected on this forum that people will not write code for other people but will point them in the right direction. Please try to understand what you have been given and don't dismiss it as "not enough" until you understand it.

I know you can do this.

Mugen Wizardry
User Banned
Posted: 20th Aug 2011 23:32
baxslash, read his code for yourself. there is LITERALLY NO notes in that section.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 21st Aug 2011 00:09
do you see ANY notes here?



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Aug 2011 01:10
The bits in
are code. The notes are the multitude of posts that have been pointing you in the right direction are what I would call 'notes'.

I think what you are referring to are 'comments' or 'remarks' (ie stuff after "rem"). Not all programmers add comments, personally I try really hard to add comments in my code as I would forget what a bit of code did and generally it makes it easier to edit code anyway.

You should be able to work it out from the code without remarks considering the kind of stuff you are doing. It's not ideal but you can't give the guy a hard time for not putting what you would call proper comments in his own code...

...just one more time: Edit Post!

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 01:14
No offense, but i shouldnt have to comment on HIS code.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Aug 2011 01:23
No offense, but the good thing about basic is that most of the time you don't need to

Example from above:


It really would be pointless for most of this code.

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 01:37
Well, my friend, this is sadly one of those times. -.- how am i supposed to learn anything if there IS no learning comments?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 21st Aug 2011 01:38
and for starters, what does -1 mean in step -1? subtract infinitely by 1, backwards? and why is he using it? why not for x = 0 to 15 ?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Aug 2011 01:55 Edited at: 21st Aug 2011 01:56
Quote: "how am i supposed to learn anything if there IS no learning comments?"

When you feel there is nothing to learn from you are limiting yourself to being taught. The only way you will ever progress in programming is to work it out

For example your next post:
Quote: "and for starters, what does -1 mean in step -1? subtract infinitely by 1, backwards? and why is he using it? why not for x = 0 to 15 ?"

Why would it count infinitely backwards? When we use "0 to 15" it starts at 0 and finishes at 15 right?

Really look at the code instead of assuming the person who wrote it was on crack if it's not written the normal way around there might be a good reason. Alternatively the person that wrote it might be on crack... but if it works who cares?

Seriously though, don't expect to be taught everything. Work it out.

EDIT: [b]USE THE EDIT BUTTON!!/[b]... sorry for caps but FGS...

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 01:57 Edited at: 21st Aug 2011 03:44
LOL! Are you saying KISTech is on crack?

EDIT:

Ok, I've tried my BEST to label what's happening with the image split.

I don't know how to fuse the texturemap with the detail map, and split the sectors...

Here's the code:



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Aug 2011 06:49
Yup, ya caught me. I'm on crack. The good Colombian stuff, not that junk from California.

Very simply, the section of code I wanted you to look at is this.


This section only deals with the Main texture, which was the texture you had repeating on each terrain piece.

Here's what it does.
- It creates 256 separate images of 256 x 256 from a 4096 x 4096 image.
- It steps through the For/Next loop backwards from 15 to 0 so that when you apply the images to the terrain using a For/Next loop forwards they are in the proper order.
- It pastes the image in a negative direction, away from 0,0 to position the piece of the texture that you want in the upper left corner.
- The lines and text you can ignore. They were there to demonstrate the inner workings of the Endless Terrain.
- It then grabs the desired 256 x 256 image.

Depending on what your "detail" texture is, you might have to do the same thing to it, or if it's just a greyscale detail texture you'll have to tile it onto each terrain object.

I can't recall if it was this thread, or another thread, but I told you at one point about the Blend Mapping On command. If you are using textures from L3DT then run the Texture, and the Normal map through this splitting routine, and use the Blend Mapping On command the way I mentioned, and I believe your terrain will look pretty close to what you want.

Like baxslash said though, it takes time, and studying these lines of code, and reading the documentation, and experimenting with code on your own for you to truly understand it.

I know what Aspergers is, and I understand your struggles. My 21 year old son has it too, and it's been a rough ride. I'm glad to see you aren't letting it stop you from doing what you want.

I do believe you can do this. It's going to take time and patience. (and a lot less double posting..)

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 07:31
Thanks KISTech! And can I have some of that s***?

Ok, so how exactly do I take 2 split textures, and texture them to the object?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Aug 2011 07:50
Individually, just like you would any other texture. Once the textures are split, you should have A Terrain Object and A texture that goes with it.

The Endless Terrain demo basically does exactly what you are trying to do, which is why I suggested you study that code. It doesn't work with terrain objects like you are, but it takes the heightmap and breaks it up into 256 pieces and uses those pieces to make 256 separate terrains. Then textures each terrain with it's own texture.

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 15:40 Edited at: 21st Aug 2011 17:25
EDIT: Here's a seemingly much easier question.

How do I apply the detail map on this mixed WITH the texture, in order to produce the tiling effect that I want, all on one mesh?

Texture Staging just doesnt work ><

ALSO, how would I save the newly created mesh terrain object (I create 1 single object with many pivots or whatnot, just like Kaedroho said), with the texture map AND detail map applied to it?



Thanks!

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Aug 2011 17:29
Quote: "How do I apply the detail map on this mixed WITH the texture, in order to produce the tiling effect that I want, all on one mesh?"


Read the help file for SET BLEND MAPPING ON.

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 17:33 Edited at: 21st Aug 2011 20:45
Ok. One more simple question. I tried to use set blend mapping on, but when I did, my whole terrain turned black...

Here's the code:



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Mugen Wizardry
User Banned
Posted: 21st Aug 2011 20:45
If we get this working, I promise, I'll be out of your hair.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Aug 2011 20:48
From the upper list, always use 3, except when it's the first use of the command. You always want to use 0 then.

From the big list, probably 22 if you're using a greyscale detail map.

Note that it matters what order you use this command in.

You'll probably want to put the detail map first, at stage 0, then the color texture at stage 1, and the normal map at stage 2.

Mugen Wizardry
User Banned
Posted: 21st Aug 2011 22:13 Edited at: 21st Aug 2011 22:13
This still turns it black...



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Aug 2011 00:16
In the next to last parameter in the second line, change the 0 to a 3, and change the 1 on the end to a 7.

Mugen Wizardry
User Banned
Posted: 22nd Aug 2011 00:32 Edited at: 22nd Aug 2011 00:32
Ok, that ALMOST worked. Now we have a NEW problem. ( The texture is also still blurry >< )

I attached the pic to this post.



CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Aug 2011 02:00
Check the help for the load image command. There's an optional parameter to not load or generate mipmaps.

Mugen Wizardry
User Banned
Posted: 22nd Aug 2011 02:08
Ok, that stops the blur. But what about the tile problem?

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Aug 2011 06:23
Really? We went over the code for the tiling, over, and over, and over..

Look over our conversation in this thread over the last page or so.

Login to post a reply

Server time is: 2026-07-19 19:06:17
Your offset time is: 2026-07-19 19:06:17