SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => General Custom Content Discussion => Topic started by: MTT9 on January 08, 2010, 01:20:42 PM

Title: Matching a texture
Post by: MTT9 on January 08, 2010, 01:20:42 PM
Hey guys,
I've been trying to make a 16mx16m prop using a texture from the game. But even if i used a tutorial by gascooker, this prop doesnt have the texture it is supposed to have. Can somebody help me so that gmax doesn't change the texture, or by changing the texture so that the rendered prop texture matches the in game one?
Sorry for my english,
Matt
Title: Re: Matching a texture
Post by: Couchpotato on January 10, 2010, 05:16:13 AM
Hi Matt

Not sure I understand what you're trying to create.   Could you please post a picture and perhaps show the link to gascooker's tutorial. 
Title: Re: Matching a texture
Post by: MTT9 on January 10, 2010, 11:00:44 AM
I took this from the SCTool:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263149420622%2Fhome%2F0x25FB1004.jpg&hash=162e1e527f41b1b47de3e34de550a69426b556d4)

Then change it using this tutorial (http://sc4devotion.com/forums/index.php?topic=5229.0)

But the end result doesn't look like the original texture
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263149410367%2Fhome%2Ftest_01.jpg&hash=54e85d3092e909cf966ac58c184ecc5764fd2f14)

I'm doing something wrong?

Matt
Title: Re: Matching a texture
Post by: Couchpotato on January 10, 2010, 05:29:09 PM
You're not doing anything wrong.   It's just the lighting in gmax so you can see it.   
It should look fine in the game.   
Title: Re: Matching a texture
Post by: MTT9 on January 10, 2010, 08:12:54 PM
Actually, it doesn't seem to be better now...

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263182984513%2Fhome%2FLE_test_01.jpg&hash=4bc2a585e45d7672956c692c3695c6c338bef01e)

After a few tests, it seems that the gmax's lights make the top lighter...

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263183123110%2Fhome%2Ftest_02.jpg&hash=2c7ee9930b6d65f9517c855e01df34389a085352)

Matt
Title: Re: Matching a texture
Post by: jmyers2043 on January 10, 2010, 08:48:15 PM
Hello Matt

I think what you're after is the impossible.

From your picture, it seems that you are trying to make a cement slab using a Maxis base texture. The problem is that the gmax slab will change brightness and hue when you rotate the game N to S or E to W. I've tried this before when making a ramp for a barn. I can use a Maxis dirt texture and make that dirt look exact after some brightness and contrast adjustment. But not from all compass headings. You may have to settle for close - but not exact. 

If that's not what you're after (or similar) then I stand corrected.

Jim





Title: Re: Matching a texture
Post by: MTT9 on January 10, 2010, 10:06:34 PM
Actually, i've tried looking this cube from evey angle...

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263189556067%2Fhome%2Fall%2520sides%2520the%2520same.jpg&hash=73935a4359173d218132a9ffe34632790149ca86)

They look the same from every angle, the problem seems to be that i can't avoid the top to be brighter than the rest...

Does anyone knows how to change the top's color to match the rest of the cube and the base texture?

Matt

Edit: when i say "how" i mean "how much" (saturation, contrast, etc).
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 12:34:25 AM
Jim,  Part of the reason you're was changing as you rotated it was because it sounds like it wasn't flat so would show different amounts of light depending on rotation.

Matt,

Realisticly you wouldn't want it to have the same shade on all 3 sides.  If you did you wouldn't see it's a 3D object, it would lose all depth.  There is more light on the top surface because it's closest to the lights and the camera.  What you really want to do is darken the whole texture slightly so the top is closer in colour to the ground plan and the sides will be darker as there is less light reflecting off them.
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 01:43:26 AM
I don't want to make a cube. I't was just a test, to show how the sides of it were as the original texture but the top was brighter.
I want to make a 16x16 plane as shown in the first pictures above.
I guess i'll have to try until i can darken the texture so that it matches the base.

Matt
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 03:01:08 AM
Ahh, in that case... yes, you are correct, that is what you have to do.  Unfortunatly, the game messes with both textures.  What you are seeing is the concrete texture messed with once by the FSH conversion and ingame lighting, and another different process where it's messed with by the BAT and ingame lighting.

I'm trying to do a similar thing with the plaza texture.  I've got close... but not close enough yet.  It's trial and error really.  You might also be able to play with the material setting in the BAT to edit the amount of light it reflects.

Aditionally, you seem to have got gascookers process to work well on the front face.  What you need to do is use that process on top face, not on the front face.  This will give you a darker original texture which, when lit, should lighten to match the ingame planes.
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 03:45:37 AM
Well...
I've been trying to apply the tutorial to the top face but...

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263210139837%2Fhome%2Ferror%2520msg.jpg&hash=5b4f6a427198dbd2e318d5ff9bdfeb051c3d716c)

When i try to change the curve i get this message, because for the output=192 input=255/255/250!
i don't know what to do about it...

Matt
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 03:59:46 AM
use 251 instead, it's as close as you'll get I guess
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 05:25:30 AM
No advance...

I tried using the closest number but the colors changes in wierd ways.
I tried using another number instead of 192 but the curve changed too much.
I tried using many numbers (0;64;100;128;145;175;192;255) but the colors changed in wierd ways once again, so i ended up with a brown texture instead of the grey ones.

I don't know what to do now... It seams that almost immposible to know how and why the top texture changes. And it's pretty easy to see that it changes in a wierd way, casuse the color 192,192,192 turns into an almost white one.

I'll try to figure this out...

Matt

PS (sorry i used the word wierd too much)
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 05:50:07 AM
It is hit by about 10 lights, and given the angle of the plane to the lights and the camera it's reflecting a large portion of the light into the camera, hence the whiteness of the face.  It will be very difficult to get it perfect, but you should be able to get it close enough.
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 06:11:02 AM
Do you think this is good enough?

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263219014703%2Fhome%2Fgood.jpg&hash=f6ccb2ece396081d9aa974e0153a2ab154e37ca1)
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 06:22:09 AM
It is pretty good I would say.  &apls

   Do you have this as a single file to change them?  If so it would be very good if you could upload it here for others. (myself included, I'm so selfish :D )
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 06:25:21 AM
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fsites.google.com%2Fsite%2Femmotic%2F_%2Frsrc%2F1263219816267%2Fhome%2FUntitled-1.jpg&hash=5c2293c31d14640debdb0df3b1be80b51085eb67)

If you can improve it, don't hesitate sharing it with me  ;)
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 06:27:06 AM
hehe, I didn't mean the texture itself.   Gascookers tutorial process had a save option, I wondered if you used that to create this and had a single file you load to change the settings.
Title: Re: Matching a texture
Post by: MTT9 on January 11, 2010, 06:30:46 AM
No... I just changed the bright, contrast and color balance many times till i got something good enough... sorry  &mmm
Title: Re: Matching a texture
Post by: Diggis on January 11, 2010, 07:24:24 AM
Thats OK, I was just trying to be lazy.  It's what I expect to end up doing as well  :'(
Title: Re: Matching a texture
Post by: Lowkee33 on February 01, 2011, 10:32:49 AM
I have a similar question.  In the process of making Chris Adam's Gravel Paths draggable I was trying to figure out how to make good street-lot transitions.  I decided to make an off-set prop of the intersection:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg706.imageshack.us%2Fimg706%2F7370%2Fhelptp.jpg&hash=0ebfee2eb1e1ff4818ec237650ebe6307e7f6e8f)
To make this I followed Glenni's Alpha Tutorial (http://sc4devotion.com/forums/index.php?topic=1127.0).  The grays match up pretty well, but the dirt is far too bright.  I am new to batting.  I played around a little with the color map of the alpha and this seems like it could get close, but would be a ton of guess and check for me.  Any ideas?  Thanks.

Also, perhaps I am thinking wrong about the whole thing.  I would rather edit all the FSH in the model than make a TE lot, but I imagine the off-set prop idea is going to have issues on slopes (but that I can test).  I also raised the model by .05 meters to get above the street texture.  Should I bring it down a little?

Then there is the fact that this doesn't have to be a 16x16 model.  I made a rectangle the "proper" size, but the texture gets distorted on it.  Is there a way to make the texture ignore the size of the model?    
Title: Re: Matching a texture
Post by: j-dub on February 01, 2011, 10:52:14 AM
I thought what you guys need to do in order to (closely) match the textures in game is that you actually have to change the values in Photoshop or something similar with the brightness/contrast, and/or color hue saturation. All I remember is someone saying subtract the value by 3 but not much more. However, basically your stuck having to experiment until you get the value right.
Title: Re: Matching a texture
Post by: Lowkee33 on February 01, 2011, 11:07:29 AM
Ah yes, editing the texture before I throw it into BAT makes a whole lot more sense.
Title: Re: Matching a texture
Post by: cogeo on February 01, 2011, 11:18:54 AM
@emmotic: Don't understand, if the plane will be at ground level, then why not use the lot texture directly? I mean why this needs to be a model?

@Lowkee: You can try doing this without using gmax/BAT. Instead you can use a 1-Z/R model (a 16x16m plane) using that texture (of course the model must be offset by 16m). Take a look at my PedMall-Compatible Trasnit Pack to see such examples. There are such planar props, using directly the very same textures as the network puzzle pieces, matching their look exactly (using the network textures as lot textures instead, would require a painful brightness/contrast adjustment).
Title: Re: Matching a texture
Post by: Lowkee33 on February 01, 2011, 11:59:04 AM
These are RKT3?  Could you explain this to me?  7 reps is not something I understand.  I would need all four rotations for the intersection.

BTW, I did some math and reduced the model and texture to the proper size.  For the slope issue I guess the best I can do is make the Occupant Size very small and have it be placed as close as possible to the edge of the lot.

:)...And, for making the smallest FSH possible, should I center the model on the axis?
Title: Re: Matching a texture
Post by: cogeo on February 01, 2011, 12:35:41 PM
RKT3 is like RKT0 or RKT1, only it references models with 5-Z, 1-R views. You can use RKT0 (1-Z/R) instead; there are such models in the pack too, for the "old" NAM versions (not in the same plugin), so check those ones. And of course it will work with all four rotations, you only need to add the kSC4BuildingModelRotationProperty property. For details, take a look at my SC4 Automata As Props (http://sc4devotion.com/forums/index.php?topic=9659.0) tutorial, it's about automata models, but it applies to most other 1-Z/R models too.

I don't think there's any need to make the model and texture smaller, this will make the whole thing harder, I'm afraid. Now about slopes, I really can't think of any solution that would make it looking right for all (or most) cases. Even if you make the Occupant Size very small and set the Orient to Slope property, the model will be conforming to the slope of the tile it is in, not the adjacent one. Maybe if you move the prop box to the edge of the lot (as far as it can go) it might be better, but I'm not sure.

And forgot to mention, shadows (from other models, like poles or subways) cast on such models look OK, unlike shadows cast on BAT-exported models.
Title: Re: Matching a texture
Post by: Lowkee33 on February 01, 2011, 01:43:40 PM
Okay, I get it.  I just had to figure out how to go from a texture to an offset-able model.    Looking through NAM I found the model you used and saw that the FSH assigned to it were just the MIPs.  I did a simple override with the Instances and in game it works (just noticeable under a brown box).  I suppose the easiest thing to do would be to copy/paste those S3Ds out of NAM and give them my own Instances.

Even the 7 rep thing makes sense to me (one type, one group, and five zooms) now.  Thanks Cogeo, this method is much more preferable than photoshop guess and check.

I believe the shadow issue you refer to occurs when the LOD of the model is above .3 meters.  (Casting Shadows on Props (http://sc4devotion.com/forums/index.php?topic=7646.0).  I came across a model recently with this issue where the shape of a non-shadowed cube was very visible. 
Title: Re: Matching a texture
Post by: Lowkee33 on April 21, 2011, 01:02:04 PM
More questions down the line.  Can these models be rotated in LE?  I am trying to make some corner lots, where the orientation is not north/south for the driveway.  Should I make a new model with the texture rotated?
Title: Re: Matching a texture
Post by: cogeo on April 26, 2011, 01:54:34 PM
The model is a prop, isn't it? Can't it simply be rotated in LE, just like all other props? Or I don't understand the question maybe?
Title: Re: Matching a texture
Post by: Lowkee33 on April 26, 2011, 01:57:57 PM
No worries.  It can be rotated in LE, but since model the appears the same in all rotations, I don't know if it would be rotated in-game.  I never tried it, but simply made new s3ds and rotated using your program.
Title: Re: Matching a texture
Post by: cogeo on April 26, 2011, 02:16:22 PM
Did you add the kSC4BuildingModelRotationProperty property? This makes models with 1 rotation view (RKT0 or RKT3) rotating in-game (otherwise they display the same side in all rotations, as you mentioned).
Title: Re: Matching a texture
Post by: Lowkee33 on April 26, 2011, 03:41:58 PM
Quote from: cogeo on April 26, 2011, 02:16:22 PM
Did you add the kSC4BuildingModelRotationProperty property? This makes models with 1 rotation view (RKT0 or RKT3) rotating in-game (otherwise they display the same side in all rotations, as you mentioned).

The driveways work great in-game.  Image Link (http://img850.imageshack.us/img850/7996/project2.jpg).  All of the lots in the picture are 1x3.  There are 2 house lots (stage 2) with roads needed in the front.  The 3 house lots are stage 3, and need corner roads.  For the front roads, the driveway works as you said it would.  The corner pieces need the driveway to be in two directions (or at least not south facing).  Rotating in LE does nothing, and I can only assume the same for in-game.  The models always face south, I guess.  To fix this I now have three driveway models using the same texture, the original, and for the East side, West side corner lots.  I didn't make a north facing one (though this is an option for LotConfigPropertyRequiredRoads?).