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 / Texture object and detailed models

Author
Message
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 31st Jul 2013 19:09
I made 3 models with Sculptris, that I've exported in .obj and converted in .x. One is 250000 polygons and the other one 35000. But when I try to apply one texture with texture object, the texture is applied individually to each polygon, I suppose, so the result is practically one color, as if I use color object. I tried to solve the problem with scale object texture, but I didn't solve it. Is there a way to apply the texture to the surface, but not to single polygons?
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 31st Jul 2013 19:59 Edited at: 31st Jul 2013 20:03
There are possibly two problems.

1) 250'000 & 35'000 polygons is ridiculously high, I think DBPro starts messing up at about 25'000.

2) If the first point isn't the cause of he problem, then there's something messed up with the way you've created/defined the UV coordinates, so the entire object is probably sampling the one pixel at 0,0 (top left corner of your texture).

Try downsizing the polygon count and see if that fixes it. The highest poly count I've ever seen in a DBPro game was 3000. Using shaders compensates for the detail again (you can generate normal and bump maps to increase the detail again).

TheComet

PirateJohn
13
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 31st Jul 2013 22:37
Quote: "1) 250'000 & 35'000 polygons is ridiculously high, I think DBPro starts messing up at about 25'000."


Actually, I was using a series of models with a combined total of over 500,000 polygons and it worked in DBPro just fine.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Aug 2013 00:01
Quote: "Actually, I was using a series of models with a combined total of over 500,000 polygons and it worked in DBPro just fine."


Quote: "One is 250000 polygons"


Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Aug 2013 01:18
This is because you haven't yet set your UV coordinates.

Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 1st Aug 2013 17:07
@PirateJohn & TheComet: Initially, the model of 250000 polygons was of 1 million, but I had to reduce it, since I has to load 8 at the same time

@Chris: I imaged it because, even if I reduce the polygons, the texture doesn't appear. So, how I set the UV coordinates? Sculptris save the object only in .obj and the texture separately in .jpg or .png, but I don't know how to combine both simply.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 1st Aug 2013 17:14
yep, the models need to be unwrapped to create a UV map. I dont know if sculptris can do it internally, but there are plenty of free tools, i recommend Blender but Lithunwrap is decent and popular as well.

while dbpro may be able to handle those poly counts, it is wasteful and unneeded. ideally, you should bake these models down to normal maps and apply them to much lower poly versions with a shader. barring that, you can most likely run a decimate/poly reduce tool on them to bring down the poly counts 25-50% in most cases without losing much detail. Most modelling packages have tools for this.

Shazam!
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 3rd Aug 2013 13:46
@Ortu: Reducing the polygons isn't a problem, nevertheless I tried to create a UV map, but I wasn't capable. Do you know someone that is capable to do it?
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 16:05 Edited at: 4th Aug 2013 16:06
Do you know what UV mapping is? If you do then skip to recommendations. It is procedure for projecting flat images on the surface of an object.

This is a 2D medium, and the horizontal axis is represented by the U; leaving the vertical axis that is represented by the V. The unwrapping process is used to pair 3D vertices with 2D pixels.

Each element contains a coordinate; and in your case your coordinates are 0,0. Therefore, the pixel at 0,0 is used to fill the entire object, which is why you see a single color.

Recommendations:
I can only tell you that what Ortu recommended. Try to search for Lithunwrap UV unwrapping tutorials; or migrate to the Blender community and learn these video tutorials on vimeo.

Navigating Blender
Blender Controls
UV Mapping Part 1
UV Mapping Part 2
UV Mapping Part 3

Finally, enable your DirectX exporter via user Preferences > Addons > Import/Export.

Import an .OBJ or .3DS version of your model; then export your UV mapped object in .X format. There is a .X importer script for Blender, but it is new, rear and on my unplugged PC which I cannot access right now.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Aug 2013 17:41
Surely the place to set the UV coordinates is in the original modeller, i.e. Sculptris? I'd be surprised if that didn't have an option to do that. If the textures show up fine there then there must be some texture coordinates defined somewhere. Perhaps there's an export option which covers it? Might be called something else, e.g. skinning, texturing, etc.

Do your objects have UV coordinates? It's easy enough to check in DBPro. Some exporters set them to zero unless you say otherwise, and others don't include them at all.



Powered by Free Banners
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 19:26 Edited at: 4th Aug 2013 19:38
Quote: "Sculptris Website: Automatic UV Creation
Sculptris automatically creates a UV map, allowing you to easily paint and texture your sculpt."


So where are they then? If the process is automated, then these coordinates are not exporting. (I am still guessing this because you have not posted any content or screenshots)

I've not had a reason to make use of Sculptris, and have not read much about it; perhaps you should consult their documentation and support; frankly I would still choose Blender for games development. I can see now why your models are so high poly...

Jonathan, are you able to either show me the model and texture or post it up in an archive for clarification?

Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 4th Aug 2013 20:21
@Chris Tale: Thank you for the advices and for the videos. I will commit myself because I don't want to depend always on the other people!
I load two of three models and the texture that I want to apply. I know that you are more expert than m and maybe you can understand better the situation if I give you the models.

http://www.speedyshare.com/gXSGd/models.zip

@Gandalf: There is an option to paint the texture. When I click on "Save textmap", It makes the texture of the models, but if I try to apply It with DB, It does not work.



I began to use recently Sculptris (I have used always Sketchup) so I am not surprised if my problem is due to inexperience.
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 21:27
As guessed, your exported models do not have UV coordinates. They do not explain to DBPRO which pixels to paint, and where to paint them. So it assumes that you want the first pixel painted everywhere along the surface of the plant.

But I must stress that you uploaded .OBJ files, not Direct X files.

An even wilder guess about Sculptris, is that it might be generating the UV coordinates on the fly, without baking them; in other words; it is calculating what pixel to paint where according to the shape of the model, and may not need to store these locations in memory or on file. A very wild guess indeed...

You may end up figuring out to export the UV coordinates, I am sure an advanced user of the tool will know how to do this.

What are your goals? Are you making a fantasy adventure platform game or something? Do you intend to animate these 3D models? Do you like modelling, or would you prefer concentrating on the programming; or are you like me, wanting to control everything from the textures to the installer?

It might be worth revealing your destination a little more, now is a good time to find the best wait to get there.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Aug 2013 22:43
Quote: "As guessed, your exported models do not have UV coordinates. "


Are you sure? I've just converted one of the objects to an X file using Milkshape and it has both normal and UV coordinates - but all have been set to zero which has the effect you describe. It's possible Milkshape added those automatically but I'm not sure.



Powered by Free Banners
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 4th Aug 2013 23:04
@Chris and Gandalf: Sorry! I am a litte careless. I upload you the .x file f^_^
Well, the fact is that Sculptris exports models only in .obj, so I must convert it in .x. Sculptris is still Alpha, so maybe there are not all of the options to look after the models.

As regards as my goal, I would like to test Dark Basic Pro lights. This is not a game, rather a coarse representation of a landscape, in this case the mount Myoboku.

http://images.wikia.com/naruto/images/8/86/The_Sacred_Oil_Fountain_And_The_Status_Surrounding_It.PNG

http://images.wikia.com/naruto/images/5/50/My%C5%8Dbokuzan.PNG

Like you, I prefer to cope without the help of other people, as far as possible. In this world, We can really count only on ourself.

Attachments

Login to view attachments
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 4th Aug 2013 23:05
The file is attached in the previous message.
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 23:06 Edited at: 4th Aug 2013 23:08
I did a similar thing in Blender. There were no UV coordinates. The UV map entry was empty; there were no zeros. If I export, this remains so. Milkshape probably does what you guessed; GG.

[Edit]Will shortly respond to Johnathan's reply

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 23:36 Edited at: 4th Aug 2013 23:40
OK first I will display your references as screenshots; you can do the same by clicking the image button with the URL highlighted in your TGC posts. (The link button can be used to link to your website locations)





Second, once my project has finished compiling; it does take long...; I will load your Direct X file....

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 5th Aug 2013 00:20 Edited at: 5th Aug 2013 00:32
OK these Direct X files are in binary format; X files can also be written in plain text. I can only import plain text Direct X files into Blender; and obviously will not be able to look at the text to see if there are any UV blocks in there because it is all cryptic.

All I get in DBPRO is a white, untextured object. But do not worry, this is everyday stuff that has a number of workarounds that you will soon find.

The goal

I am no Naruto expert, but I know a thing or two about Blender and DBPRO. And by looking at the references images really indicates why Skulptris might be a good additional tool for the job; so you have not made a mistake.

Although you can sculpt and paint in Blender, it is down to your personal preference what tools you want to use to create the scene. What matters is that your scene manages to load into DBPRO correctly and runs smoothly enough for the job.

You can use Skulptris to shape things together, then have it UV mapped when and if you figure out how to export UV maps with Skulptris; or handle UV mapping as a separate task in an external editor such as Blender or your engine.


No doubt you are probably aware that Skulptris generates lots of polygons. Polygons do not slow down movie playback; how can it; all of the frames are saved into a sequence of images and sound. All the rendering takes place beforehand.

On the contrary, if you want people to view these scenes in realtime on poor machines; you will likely find that these excess polygons will make the scene look choppy.

Later on you will probably work things out for yourself so that the amount of polygons and objects in view are efficient. Things like exclusion, culling, decimation, vertex shading and instancing will come into play by then.

All I can say is if you want this to look good in DBPRO, better learn how to make use of HLSL shader files. You will need your Graphics Card (GPU) to assist with the lighting, art and texturing; the best way to do that is with shaders. Fortunately there are loads of samples in the forums and you can ask any questions.

Take a look at some of these projects and see how people achieved their texturing effects. Dark Lights is a lightmapping tool that can help with lighting, but that is optional.

A guy who goes by the name EVOLVED created useful creative tools for DBPRO scene development. He has numerous lighting projects, and his Advanced Lighting project is an attractive solution, however not the easiest to work with, even for me... given the name of the project... His website is here.

Keep a reminder to check my profile next year, I will be releasing a shaded scene editor for all levels of experience.

If you still have trouble with UV mapping, don't forget those video tutorials I posted. The Blender edit-mode hotkey for unwrapping is U. You select the option, usually cubic. All of that is covered in the videos and the containing tutorial series; all except for exporting to Direct X, which I explained earlier. A texture would be applied in Blender materials or in DBPRO.

Hopefully you will find a Skulptris solution.

Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 5th Aug 2013 12:19
I uploaded again the models in .x ASCII. Can you read it?

This morning I begin to see the videos. It will be very interessant! If I have some problem, I write in this post and wait some answer.

Surely, Sculptris generates lots of polygons, but It is possible to reduce it through an option of menu. In any case, I have a powerfull pc, so I can run complex models also in realtime on DBPRO. The problem is making it work correctly (^_^

A good solution to the surplus of is using bump, I read, but I never used it, so I should train both in the bump and in the multitexturing.

I already saw the shader pack and It was very interesting. In particular, I spotted the Per Pixel Lighting. The problem is I never used shaders in my life, so I don't understand the commands of vectors that I come across the project, even if I studied at the school what they are. I try to isolate the code that I am use.

Thank you for the site of EVOLVED. I promise to go through it!
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 5th Aug 2013 12:20
The file is here!

Attachments

Login to view attachments
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 5th Aug 2013 17:23 Edited at: 5th Aug 2013 17:27
Ok so your Direct X file contains this as its UV coordinates for its 7000 polygons:
Quote: "template MeshTextureCoords {
<F6F23F40-7686-11cf-8F52-0040333594A3>
DWORD nTextureCoords;
array Coords2d textureCoords[nTextureCoords];
}"


Is this a pair of Sculptris Direct X file exports? Or did you use a third party program to export them? (I wonder why the exporter creator did not want to output the UV coordinates )

It did not even export the texture applications. A better export tool would have assigned a material texture so you would not need to also use the Texture Object command.

Dark Shader is a nice asset for simple DBP shader development; and a good learning tool. Openning shader projects and playing around with the variables and textures will often show you what is happening. Any shader commands you do not understand are likely documented here.

If you can model the whole scene, the final step is to light it up and shade each limb accordinly.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 5th Aug 2013 17:46
I downloaded Sculptris. It is very new and extremely limited.
I would highly recommend using a more mature modeling tool until
they get out of Alpha and are at the very least well into Beta.

You'll save yourself a lot of time and headache using something
that can directly save to .X format as well.
Jonathan Archer
11
Years of Service
User Offline
Joined: 29th Jul 2013
Location: Italy
Posted: 5th Aug 2013 18:15 Edited at: 5th Aug 2013 20:24
I thought that there was at least a demo of Dark Shader, but It have to buy. Well, at the moment I don't feel up to buy it. So I try to manage.

Ah, I inform you that finally I succeeded in resolving the problem with the textures. Of course, I am still not an expert with Blender, but at least I can continue with my project. Thank you!



With regards to Sculptris, I hope that in final version there are more options because the software is very interesting.

In the meantime, this afternoon I tried to isolate the code for Per Pixel Lighting, but I did not come out for some reason. So I think I have to write a new post
Inflictive
15
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 7th Aug 2013 04:12
For modeling software I would recommend Wings 3d instead of blender, it's much simpler and modeling is much easier, as Wings is purely modeling software where as Blender is... pretty much everything...

It can export in .x, make uv maps, and do just about everything except animation. It's also much easier to make low-poly models in it (250,000 is way too high).
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2013 21:36
Quote: "Ok so your Direct X file contains this as its UV coordinates for its 7000 polygons: "


That looks like a standard template definition to me. The coordinates themselves should be listed elsewhere in the file (I haven't time to check right the file now - getting strong hints it's my turn to prepare supper ).



Powered by Free Banners
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 7th Aug 2013 22:15
my latest project has 85000 polygons and DBpro handles it very well even on my rubbish laptop.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2013 02:37
On a single limb?



Powered by Free Banners
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 8th Aug 2013 21:35
No. On multiple objects.

Login to post a reply

Server time is: 2024-11-23 12:34:17
Your offset time is: 2024-11-23 12:34:17