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 / Combining multiple objects into 1

Author
Message
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 11:17
Looks like I have 2 routes I can choose to keep my texture data intact.

This option I have working in a test file:
OPTION #1
make mesh
add limb to object
texture limb
position limb
(repeat 600 times for the floor objects)

OR

OPTION #2
Skip the mesh making part and
use Glue Object to Limb.

This I cannot get to work as I get error about missng limb unless I use limb 0 each time..which is useless (I think)
Maybe I have to add at least 1 limb to my first object with Option #1, then the following objects glue object to limb

Right now I'm sticking with Option #1 as I have it working.

I hope it actually improves things, as I hate wasting time doing something that turns out useless

Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 11:21
Had a brief panic about the AF shader...but I see there is a set limb effect Hope it works as well as using it on separate objects.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 27th Feb 2018 14:00 Edited at: 27th Feb 2018 14:05
If your purpose here is combining objects to improve frame rate, then Glue Object To Limb will not help.

Option #3
Create the mesh using an external program. Either a level editor of your making or some sort of modelling program.

This way you aren't hard coding your game areas/levels into the program and you don't end up with huge sections of code creating/arranging objects which can't be easily changed.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 14:33
Quote: "This way you aren't hard coding your game areas/levels into the program and you don't end up with huge sections of code creating/arranging objects which can't be easily changed."


I plan to go procedural for (some) levels (in the longer run).

With (my) Option #1, I can save all my handcrafted levels as DBO Objects, already pre-textured and ready to go. Then it's just load and go, as they say.

I spent a lot of time on my "build level from Planes" code to get rid of the vertex fighting. I don't think I'm going to give that up easily.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 14:45
My maps currently have 5 layers

Walls/Floor layer

Texture Layer

Detail Layer (bushes, trees, water tiles, etc)

Trigger Layer (opens a door, toggles a shop owner, toggle going to a new area (level) ).

Monster Layer (I have random encounters, but I will also place crafted encounters with this layer)

I'll probably add more Layers as I go

So, so far for a 40x40 map I have 5 40x40 Layers (all in the same TXT file)

Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 27th Feb 2018 14:47 Edited at: 27th Feb 2018 14:48
Zep wrote: "With (my) Option #1, I can save all my handcrafted levels as DBO Objects, already pre-textured and ready to go. Then it's just load and go, as they say."


Then you have the beginnings of a level editor.

Figure out how to place and position the objects with controls and not by changing the source code each time. Save the DBO. Also maybe have a secondary file you make along side the DBO for extra things like a path name or id number for which music file to play on that stage, coordinates for enemy spawns, etc.
Then you ease yourself into a proper level editor to make your game.

Aw i didn't see your full reply. Very good then.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 27th Feb 2018 15:07
Zep wrote: "My maps currently have 5 layers"

Since you are breaking things down into a grid I will suggest something that will help you greatly.

Consider adding an extra layer called a portal or zone layer. This will store a number for which zone the square is in.
You can then decide which zones can see each other and which cant. This will speed up and enhance your ability to hide sections of the level that don't need to be drawn. So for example you can have nothing drawn on the other side of a wall, instead of merely using some distance calculation and having some things drawn behind the wall which would not be as efficient.

So imagine each grid square is a assigned a number pertaining to which zone in the level it is in, and imagine there are a few of these zones in a level. (for example if you quartered the level into 4 zones).
Then you can make a 2D array and store a 1 or a 0 depending on which zone can or cannot see which ever other zone. When you run through which objects can or cannot be seen, it's simple matter of find which zone the camera is in, find the objects zone, can these zones see each other? Exclude On/Off Done.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 15:10
Yeah, I design the walls/floor layer first.

The cut and paste that it to make another layer and then add the other stuff.

It works pretty well, but the layer idea is not my own, I saw it on the net somewhere.

My ultimate goal...make a highly configurable game, maps, objects, details, etc all from one simple text file.

I may create a "layer editor" at some point that creates that TXT file for you...but that's not fun for me right now

Seriously, a simple level layer 1 would look like this

W=Wall F=Floor

WWWWWWWWWW
WFFFFFWFFFFFFFFW
WFFFFFWFFFFFFFFW
WFFFFFFFFFFFFFFFW
WWWWWWWWWW

Then I'll cut paste and remove an F and add a detail "B" bush "T" Tree or whatever.

Same with the other layers, they all start out as a cut/paste of layer 1.

All that layer data is stored in a 3 Dimensional Array called MapData()

So it's easy to take my X,Y Character's map position, and index into the array and to the various layers in that array.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 15:12
Quote: "Consider adding an extra layer called a portal or zone layer. This will store a number for which zone the square is in.
"


Yes, already have that, it the first 15 or so lines of the mapdata txt file
Map Name
Player Start Position
Which Direction should we face.
etc...
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 27th Feb 2018 15:21 Edited at: 27th Feb 2018 15:24
No I mean if your map had like 10 zones that you thought up. Then you decided that some of those zones can't see each other. You could give each square in the level a number for which zone it was a part of and that would make it easy to determine if you should cull objects. This would let you very easily reduce draw calls and poly in a powerful way.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 15:49
Quote: "No I mean if your map had like 10 zones that you thought up. Then you decided that some of those zones can't see each other. You could give each square in the level a number for which zone it was a part of and that would make it easy to determine if you should cull objects. This would let you very easily reduce draw calls and poly in a powerful way."


Oh, I plan on gating that with camera range and strategically placed walls and doors... I think.

But you're idea is sound, I may look into that.

I'm not making some open world sandbox thing. I mean, 40x40 is pretty damn big as it is if I fill it with interesting things to do. But in the grand scheme...40x40 is not huge fps killer size.

Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 27th Feb 2018 15:54
What I suggested will allow you to say have a rooms next to each other, and nothing gets drawn in the other room since you shouldn't be able to see the things and you set them up as separate zones that are marked down as not being able to see each other.
If you relied on camera range then nearby rooms would render behind walls when they ideally should not. it's why I suggest this solution.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Feb 2018 16:45
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 27th Feb 2018 23:55
Quote: "What I suggested will allow you to say have a rooms next to each other, and nothing gets drawn in the other room since you shouldn't be able to see the things and you set them up as separate zones that are marked down as not being able to see each other.
"


Yes, I get that, but with the size of my levels, I don't think that is nesc. Right Now.

Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 04:25
Well, making the floors all 1 object (by adding limbs to object) then saving the object, then loading the object...didn't save anything, same amount of draw calls and polygons.

I think making the whole object a mesh would be the only solution, but then I lose the ability to texture individual floor tiles, as making mesh deletes the texture data.



Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 05:57
So to get my draw calls down, for the floor for example.

I just keep adding them to a mesh

At the end I make object from the mesh

now, I have no texture info

I found save mesh, save the mesh as an texty X file.

Now I have to load that X file into another program, and hopefully, re-texture it with it's original look, and load it back into DBP as an X model.

So what (preferably free) program would let me achieve that?

I've gone this far, I might as well, test it.

oh, the (free) program to re-texture the planes in the mesh would need to run under Win XP.

Know of anything like that that exists?
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 09:58
Our father who art in heaven....

Got it working with FragMotion!

Took me a good long while to figure out how to texture a face...but finally did it and have multiple textures on the floor.

Now that I know how to do it, should be pretty easy to do more maps.

So now my test floor(15x10) is 1 draw call! around 300 polys

Down from 150 draw calls.


Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 28th Feb 2018 11:32
Zep wrote: "Well, making the floors all 1 object (by adding limbs to object) then saving the object, then loading the object...didn't save anything, same amount of draw calls and polygons."


Gandalf had suggested adding objects to limb, but only in the context of using the Exclude Object Limb command. This is helpful but not in an obvious way and has it's limits. You could use the limb tree of the object like a BSP tree in some situations, but this is entirely pointless if you are using a grid like you are since the other suggestion I gave is far simpler and about as effective. I have read that traversing limbs is inefficient and time consuming which would drag that method down. Compare that to some simple math to find which zone something is in. If you were not using a grid then Gandalf's method becomes a clever way to section out major spaces in a level, where you can essentially tree sort objects to cull.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 12:10
Quote: "So now my test floor(15x10) is 1 draw call! around 300 polys

Down from 150 draw calls.
"


I'm in the middle of teaching some children's English classes, as soon as they're done (another 1.5 hours). I'll try pasting that object 10 times or so to simulate a 100x100 floor. (no walls yet), Before I go converting my project to this.


Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 28th Feb 2018 13:07 Edited at: 28th Feb 2018 13:19
I just want to correct myself and say that Gandalf's suggestion and my suggestion can be combined, if you follow the rule that an object only be in one zone at a time.
In my case I made a bunch of levels before implementing zones/portals so in some cases a double sided wall section lines more than one zone. This associates that piece with more than one zone so I have an ingrained impression that the methods cannot be combined.

Gandalf's suggestion is great because you can basically say, which zone is the camera in? 17. Then run through each of your zones maybe you have 40, can zone 17 see that zone? no? and you exclude the limb and everything attached to it (everything in that zone) gets excluded. With my suggestion alone you are running through maybe several thousand objects finding the zone each time and individually excluding them. Gandalf's suggestion requires any moving objects be constantly removed from and attached to the correct limb for the zone/portal they are in. It requires they only ever be attached to one.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 13:49
You guys realize this is a step based game, right?

There is No AI, No Open World, and honestly, 40x40 IS big enough and runs at a decent frame rate as is (before I switch to the new object I made).

If you are not moving, nothing happens.

It's step based and level based, sorta like L.of Grimrock but without the Monster Dance AI.

Battles are static, with a picture or Model of a monster and an attack/battle menu. I'm not going all triple AAA game here, especially with my programmer art.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 13:50
I think max map in Grimrock was 30x30 (I could be wrong, been a while since I played it.)
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 28th Feb 2018 14:35
I mention things with the understanding that other people might be watching and using the information for their purposes. So I tend to throw in a few extra details.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 14:37
The 100x100 floors are running at 22 draw calls, 3,916 polys, 600 FPS (viewing the whole map floors at once)

A LOT BETTER than the 30 FPS I was getting before when they were all single objects. That is VERY acceptable for a 15 year old laptop.

When I add the walls tomorrow, I'll post more results.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 14:46
I like the "Zones" "Culling" idea guys, don't get me wrong. I may look into that in the future if I need it, but I'm not keen on optimizing something that doesn't need optimizing right now.

What I am doing now is perfectly acceptable to me.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 14:49
ps,

Draw calls go up by 1 every time I add a new texture to the floor mesh X object in FragMotion.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 14:55
Also, that is cloning and position the original object to get to 100x100.

If it was a true 100x100 floor map, I'm sure the results would be even better.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 14:56 Edited at: 28th Feb 2018 15:03
In other words, 1 draw call for the original object + a texture * number of additional textures.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 15:24
Quote: "I mention things with the understanding that other people might be watching and using the information for their purposes. So I tend to throw in a few extra details."


If they need that, of course. I've no problem with that.
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 28th Feb 2018 15:27 Edited at: 28th Feb 2018 15:57
Each extra texture related draw call used in the situation you have is caused by sub meshes. Basically a sub mesh is a way of producing the same models geometry fast, consider treating it as a limb you have zero control over as DBP has no sub mesh commands. What happens can be seen in the object file, each texture is a material, the material can actually exist and not be used(there may be a way of assigning tri's to materials in DBP via peek/poke direct memory access but lets not go there), in each case the material that has tri's assigned to it has a sub mesh is generated, all the tri's for each submesh are there(last i checked DBP still includes them in statistic() for tri count), they just show the material assigned(please be aware that a texture is only part of a material, diffuse, lighting, shader stuff etc are all components of a material). I may not have explained this too well, some further info you may find of use where my explanation is lacking:
https://forum.thegamecreators.com/thread/211829

That said, one of the others is bound to show up and correct me

Edit: Ignore that link, thought it was something else but its my own thread lol, I had it bookmarked and renamed submeshes for some odd reason given I barely mention them! Pretty sure I thought at the time I was bookmarking some one elses thread, which I can't find now :/
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 15:36
Quote: "I may not have explained this too well, some further info you may find of use where my explanation is lacking:"


Ha ha, yeah. I'm not sure what you are trying to explain. (I am possibly dumb, not your fault )

It's sleep time here in Vietnam, so I may wake up to a new revelation.
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 28th Feb 2018 15:56
I was wrong, that link is about submeshes as well as all that other stuff(you can probably skip first few posts), I was remembering wrong and labelled the bookmark correctly, however my explanations there are only marginally better. Others do cover it, but it is based on the understanding that we all knew a fair amount about other fvf mesh/material stuff that you won't have dealt with yet(probably). In any case use them to your advantage, Rudolpho could not imagine a use for submeshes as he mentioned in said thread, seems you have also found one
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Feb 2018 15:56
Mage, you said:

Quote: "I mention things with the understanding that other people might be watching and using the information for their purposes. So I tend to throw in a few extra details."


Very much appreciated . In fact it's mainly your suggestions that led me to bookmark this thread. The forum is here for everyone, not just the original poster - and even Zep might find it all helpful one day . In fact it seems he's very satisfied with progress so far.
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 28th Feb 2018 16:05
Quote: "So I tend to throw in a few extra details"

Keep throwing! I love it when there's lots of info to be had even if it's stuff I already know - sometimes a tiny detail is all it takes to make a difference and as GG said, it really is appreciated and no doubt by most if not all members - who have a bit of common sense that is(that's pretty much everyone but me)
Win 7 Pro 64 bit SP1, AMD A4-5300 APU 3.4GHz, 8GB DDR3, NVidia GeForce GTX 750 1GB GDDR5, ASUS A55BM-E
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 28th Feb 2018 16:33
Thanks for mentioning it. It let's one know they aren't wasting their time talking to nobody.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 28th Feb 2018 23:54
Good Morning Vietnam!

Going to do a few more tests with FragMotion to test if it is the textures causing extra draw calls.

Then I'll set out with adding the mesh combining code in my project.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 00:45
Testing complete.

Confirmed. Adding a new texture to the floor mesh causes 1 additional draw call. Doesn't matter where you place them or how many times you place them.

I kinda like the idea of separating the floor object from the wall object. I think it will make the floors much easier to texture.

I'm gonna finish inserting my combining code now, I'll try it both ways. 1 object floors/walls and 2 objects Floor and Wall.

Then do the 100x100 test on both ways and see what kind of hit I suffer with 2 objects compared to 1 object.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 1st Mar 2018 01:18 Edited at: 1st Mar 2018 01:20
Use an atlas texture, basically combine 4 textures into 1 that is 2x2, UV map your tiles into the correct texture section. You can then render all tiles that use any of the 4 in one draw call instead of 4
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 01:38
Quote: "Use an atlas texture, basically combine 4 textures into 1 that is 2x2, UV map your tiles into the correct texture section. You can then render all tiles that use any of the 4 in one draw call instead of 4"


Sounds like a good idea. I'll look into that later.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 03:16
Success!!!

100x100 map

19254 Polys
1 Draw Call (only 1 texture, haven't re-textured it yet, walls and floors all 1 object)
424 fps (used to be less than 30 fps the old way)

This is awesome!
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 03:29
I doubt I'll make any real 100x100 maps. But now I know they will run well if I ever decide to make one.

30x30 or 40x40 will probably be my limit as far as making maps go.



Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 03:31
This is sweet work...it's only 10:30 am here, but I may have to crack open a beer to celebrate.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 10:26 Edited at: 1st Mar 2018 10:28
Since my idea worked so well, I'm going to go ahead and build a separate "map compiler", I split off the old build map code in the project until such time I want to do a procedural map.

It took over 2 or 3 minutes to build that 100x100 map into 1 object. I had actually thought I coded an endless loop by some mistake.

When you have a black screen for 2 or 3 minutes...one starts to panic.

After building the map compiler, I might take a shot at building a simple "map editor".

Since the base map is all 1 object now, i'm not sure if any of the zoning or culling ideas presented will work on it itself. However I may look doing that with the "details" layer or some other layer I might add.

I may even go so far as to build my own "object texturing" tool so I can do away with having to use FragMotion. We shall see....
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Mar 2018 11:53
Quote: "When you have a black screen for 2 or 3 minutes...one starts to panic."


Yep, I know that feeling well. One solution, if it's needed every time you start up your game, is to split the object creation into chunks or phases and print an updated progress bar or similar at the end of each chunk. If nothing else it reduces the stress of waiting .

Quote: "This is sweet work...it's only 10:30 am here, but I may have to crack open a beer to celebrate. "


Getting something like that finally working certainly deserves a reward . However, I'd be wary of being tempted to "improve" your code until the effects of your "celebration" have worn off . But if the temptation is irresistible make sure you back up what you've done first.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 12:03
Quote: "Getting something like that finally working certainly deserves a reward . However, I'd be wary of being tempted to "improve" your code until the effects of your "celebration" have worn off . But if the temptation is irresistible make sure you back up what you've done first.
"


Ha Ha! Well, I had more than 1....then I took a 2 hour nap, haven't touched any code since. Just a lot of thinking of creative ways to do what I need to do.

Now I teach an adult English class for an hour, then I will try to apply that KD AF shader to the single obect map and see if that still works.

I keep a notebook of my ideas and/or I throw them into the TODO section in Synergy of my Main project.
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 14:52
Tried the KD AF shader,

While it appears to work, DBP itself it seems cannot texture such a large object correctly. (yes, i tried all the texture options)
My seamless Wall Texture has very visible seams

So, I will have to come up with a manual texturing option.

I will experiment some more with texturing in FragMotion and try KD AF again.

Gonna do 1 quick test wih FragMotion right now (1 texture)

Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 1st Mar 2018 15:10
I don't think it's working in FragMotion either(still seams), I think the problem is the texture is an odd shape 680x460

I'll try some more seamless but "square" textures tomorrow. Since I am only texturing 1x1 "planes" basically in the object. So square sounds like a good idea.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Mar 2018 22:53 Edited at: 2nd Mar 2018 01:07
I doubt changing the image dimensions will have an effect. The problem is probably caused by filtering and mipmapping which means that when your application is trying to use a pixel along the join it will use an average of neighboring pixels in the image which is not what you want when using a texture atlas. AtomR and I had a detailed look at this issue a few years back. I'll see if I can dig out the thread. The details are a bit messy if I recall correctly.

Edit: Here's where the discussion about seams starts (it was buried in the Learning to Write Shaders sticky thread). Sounds related to your problem with seams:


https://forum.thegamecreators.com/thread/91453?page=23#msg1719505
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 02:26
Quote: " The problem is probably caused by filtering and mipmapping which means that when your application is trying to use a pixel along the join it will use an average of neighboring pixels in the image which is not what you want when using a texture atlas"


In my old code (before the object combining), when I was texturing each individual plane, I did not have the seams when the planes were placed together.

Only now that the level is one huge object.

Doing some more tests...
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 2nd Mar 2018 02:57
DOH!

The problem was using JPGs as textures, changed to PNG and the seams are gone.

I think I even read about that somewhere, but forgot.

Login to post a reply

Server time is: 2024-04-19 16:04:29
Your offset time is: 2024-04-19 16:04:29