Planetside Software Forums

General => Terragen Discussion => Topic started by: PG on April 03, 2009, 10:39:00 AM

Title: Luminosity for Obj model
Post by: PG on April 03, 2009, 10:39:00 AM
Hey guys,
I'm trying to do a scene in which all light sources are pointing towards the camera and so a model I've placed in the scene (a cruise ship) is in complete darkness. Is there any way I can increase the luminosity of the textures that are built into the obj file? I tried, with a different model, to increase the luminosity with a default shader but I don't think it had any textures because the whole thing went white.
Don't really deal with surface shaders most of the time :D I just want them to be visible without adding light sources that would mess up the original lighting.
Title: Re: Luminosity for Obj model
Post by: Matt on April 03, 2009, 03:32:26 PM
The luminosity has its own texture settings. You probably want to give it the same texture as the diffuse colour.

Matt
Title: Re: Luminosity for Obj model
Post by: PG on April 03, 2009, 04:18:10 PM
Ah, scratch that. A warning came up with OBJReader: could not open mtllib. Attempted "G:\Terragen 2\Models\cruise" and "cruise"
There is a material library called cruise ship.mtl so why it's looking for one called cruise I don't know, the model itself is called cruise ship too. Is there some way I can fix this? Maybe with library and user content folders in preferences?
Title: Re: Luminosity for Obj model
Post by: Tangled-Universe on April 03, 2009, 04:20:54 PM
ehrr....is it me or can't you just simply rename the .mtl-file?
Title: Re: Luminosity for Obj model
Post by: PG on April 03, 2009, 04:24:09 PM
Lol. that'd be nice. ;D
I just tried it but it didn't work :-\
I think that it's looking for a folder called cruise because it can't find a material library in the same folder as the model file
Title: Re: Luminosity for Obj model
Post by: Tangled-Universe on April 03, 2009, 04:33:28 PM
Quote from: PG on April 03, 2009, 04:24:09 PM
Lol. that'd be nice. ;D
I just tried it but it didn't work :-\
I think that it's looking for a folder called cruise because it can't find a material library in the same folder as the model file

If I remember correctly OBJ can have problems with folder/filenames....it doesn't like spaces etc.

So maybe if you rename your file to cruise_ship?
Title: Re: Luminosity for Obj model
Post by: PG on April 03, 2009, 04:51:19 PM
Na I'm still getting the warning. The funny thing is, pretty much every result on google about obj and the mtl library is about how most people don't provide the .mtl file. But now I've got it and it doesn't work ;D

Edit: It does work. I forgot to go into the obj file and change the link to the material library. I'm just rendering it now to see if the materials show up properly.
Title: Re: Luminosity for Obj model
Post by: Mandrake on April 05, 2009, 09:55:36 PM
Run the obj through poseray
Title: Re: Luminosity for Obj model
Post by: PG on April 06, 2009, 04:05:08 AM
Thanks, I'll give that a go when I get back from work.
Title: Re: Luminosity for Obj model
Post by: PG on April 06, 2009, 10:35:39 AM
OK I'm back from work, short shift thankfully, and tried poseray but don't really know what it is I should be changing. The textures that the cruise ship uses were missing from the download pack so the first thing I did was download and attach another one. But past that I don't know what I'm doing. All I want to do is have the windows emit a certain amount of soft light and maybe some diffuse lighting on the rest of the boat to mirror the rather "diverse" lighting of the scene. I saw an option for "reflectivity" on the finish option in Materials but don't know how effective that would be for me. I would upload the model but obviously I don't have distribution rights. But it's a free object so here's the link just click on the image.
http://3dcollections.net/?a=download&id=9936
Title: Re: Luminosity for Obj model
Post by: Mohawk20 on April 06, 2009, 10:58:37 AM
You have to add luminosity in TG.
The default shader that textures the windows has a luminosity setting, where you can browse to an image map, or just set a colour and strength.
Title: Re: Luminosity for Obj model
Post by: PG on April 06, 2009, 12:14:53 PM
I tried that but the windows are, for some reason, grouped with the top of the ship. So if I add luminosity to them with TG2 then half the ship starts glowing ;D
Title: Re: Luminosity for Obj model
Post by: Mandrake on April 06, 2009, 06:00:47 PM
Well, A wise old ogre once told me, that, it's often easier to build your own model, then to fix someone else's.
Title: Re: Luminosity for Obj model
Post by: PG on April 06, 2009, 06:39:25 PM
Would be better if I knew how to. I tried it a few times and only managed to make a wonky box. :-\ Anyhow, I managed to detach the windows into their own model and retain the same origin as the rest of the ship so I can load the two (ship and windows) and apply luminosity to just the windows.
Title: Re: Luminosity for Obj model
Post by: Mandrake on April 06, 2009, 07:28:53 PM
Now your cooking
Title: Re: Luminosity for Obj model
Post by: jo on April 06, 2009, 08:25:14 PM
Hi,

I have some information about why some mtl files don't load. Basically it comes down to the fact they have spaces in the names. The OBJ spec doesn't support this. You can use more than one mtl file in a model and spaces are used to separate the filenames on the mtllib line. This means a line in the file which looks like:

mtllib cruise ship.mtl

is strictly speaking referring to two files - one file called "cruise" and another file called "ship.mtl". So basically that's the problem.

It's easy enough to fix yourself. Rename the mtl file so there are no spaces in the name ( i.e. cruise_ship.mtl ). Next open the obj file in a text editor and look for the line which starts with mtllib. It will probably be near the top of the file, but search for it otherwise. Change the mtllib line to refer to the renamed mtl file:

mtllib cruise_ship.mtl

Now everything should work as expected.

There are obviously a lot of obj files which do use spaces in the name of the mtl file. I came across one myself when I was looking for models to test the new texture system with. I'll look into improving the handling of this in TG2's OBJ importer.

Regards,

Jo
Title: Re: Luminosity for Obj model
Post by: PG on April 07, 2009, 07:25:30 AM
Yeah I tried that but I think the mtl file was actually incomplete. I loaded it into poseray and half the materials were missing. I loaded it into 3ds max and did it myself and they were all there and here's the result. Not the most technically challenging scene in the world but I learnt a lot doing it.
Title: Re: Luminosity for Obj model
Post by: bobbystahr on May 09, 2009, 03:28:22 PM
That's one awsome summer night fireworx cruise you got going there...having a similar problem but as I don't have Max I'll not be able to go that route.
Title: Re: Luminosity for Obj model
Post by: PG on May 09, 2009, 04:42:07 PM
Night scenes are a pain in the arse with terragen most of the time because having the sun more than 5 degrees below the horizon has the effect of essentially deleting the sun, so there's no light at all.
Title: Re: Luminosity for Obj model
Post by: sjefen on May 09, 2009, 05:05:44 PM
But the "Light exposure" helps a lot on night scenes.

- Terje
Title: Re: Luminosity for Obj model
Post by: bobbystahr on May 09, 2009, 05:09:09 PM
Also you can position the sun where the moon would be in your scene, preferably off camera, and dial it back to like 1 or even .5 and take care of the darkness of the sky in the atmosphere Tab..just a thought as I ain't done any night scenes yet.. ...
Title: Re: Luminosity for Obj model
Post by: Oshyan on May 09, 2009, 05:20:37 PM
The lighting in TG2 is pretty realistic. With the sun 5 degrees below the horizon, if you tried to take a photo in real life it would be quite dark. You would have to use a long exposure to get much of anything. In TG2, just increase the exposure (gizmo on the bottom-left of the 3D preview with a +/- ). You'll need to have GI enabled to make this work best, and this is a case where increased GI settings may help.

- Oshyan
Title: Re: Luminosity for Obj model
Post by: bobbystahr on May 09, 2009, 09:19:55 PM
Must try that...keep forgetting bout that handy exposure slider.. ...