Elvas Tower: Shadows - or not ??? - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Shadows - or not ??? Rate Topic: -----

#11 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 19 April 2011 - 06:28 PM

Thanks; I can reproduce the problem here and it's a fun one. :)

  • The texture has a small (2 or 3 pixels) of transparency across the top.
  • The texture coordinates used for most of the wagon are (1, 0) - i.e. in the transparent area.
  • The shader name is set to a non-alpha blending one (TexDiff) so no alpha blending occurs when drawing normally.
  • The shadow generation does not take the shader name in to account, so considers it transparent. This is the bug.


I tried editing the texture to not have the small transparent bit at the top, and that did make it produce a shadow but it also went a bit grey instead of white... though that could just be because I used my own experimental .ace editor.

So I think the result here is that using areas of a texture that have transparency with a shader name that ignores transparency (to get solid visuals) doesn't produce shadows. It is, unfortunately, not so simple to fix. :bigboss:

#12 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,361
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 19 April 2011 - 10:23 PM

IIRC the use of an alpha anywhere on a texture will drop the color quality of the entire texture (at least in MSTS, not sure about OR). So in MSTS it's better to move all areas of alpha off ordinary texture files to a dedicated alpha texture file. AFAIK the 2nd file will not effect performance in any significant way.

#13 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 20 April 2011 - 03:24 AM

Morn'n Folks,

The thin black band on top of the alpha was deliberate - as it seems to address a constant with the use of MSTS shape files... For some reason when you map to the very edge of an ACE - the shape will get some bleed over of the texture (1 or 2 pixels worth) from the opposite side of the ACE... Most times it's not very noticeable - however - when you locate an alpha'd wheel on the edge it becomes very apparent... It's those small thin slivers of texture that don't get alpha'd out and outline the original square face used for the wheel... If you look carefully at the model I sent you - the top edge has been fixed and it's not visible in the Sim - I did not do the side edges yet and you will see the problematic outline in OR... In order to clean it up I need to continue the black band down the side which should remove those edges as well...

From my observations - it seems that OR does not reduce the color quality when using alpha'd ACES as MSTS does... The first thing you notice in MSTS is that delineated banding effect that occurs when using gradients on large textured faces with an alpha’d ACE... We usually reduce the banding in MSTS by introducing noise... That doesn't seem necessary in OR - as the colors appear to match the original quality of the ACE... So in shape viewer - when you check the "Low Quality Texture" option - that shows how it will appear in MSTS... The normal high quality option is how they appear in OR - without the degradation...

Regards,
Scott

#14 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 20 April 2011 - 05:44 AM

Hi...

Oh - and - I also double checked Larry Goss's PS1 model last night - he uses a total of (2) ACES - both have alpha channels - and they DO cast shadows in OR... So his work fine - it can't just be an alpha channel issue... Hmm - could it be the alpha priority setting - I did use "1" - maybe I should try another value ??? I'm only aware of two settigs in 3DC that have any control over the use of alpha channels by the shape file... One field is called "Tx Alpha" and it can only take two keywords: "Transparency" or "Translucency"... The other field is called "Alpha Pr" and it takes a numeric value to set the priority... I'll look into this again tonight... Appreciate the help...
:bigboss:

Regards,
Scott

#15 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 20 April 2011 - 06:53 AM

The problem isn't that the texture has an alpha channel, it's that the texture coordinates used are in the transparent area. If it wasn't for the specific MSTS shader names that don't do alpha blending, the wagon would be nearly invisible (I saw this during my debugging).

#16 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 20 April 2011 - 07:09 AM

Hi James,

OK - gotcha now - my issue - I'll check the mappings to the ACE when I get home tonight... Maybe I fat fingered something... Thanks for looking...
:bigboss:

Regards,
Scott

#17 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 20 April 2011 - 07:22 AM

And just to be ultra-clear: the lack of shadow is an Open Rails bug. You just may be able to work around it by using different texture coordinates.

#18 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 20 April 2011 - 04:13 PM

Hey Guys,

Thanks for the help... The part of the problem on my side - was as James identified - the faces were not mapped to the location on the ACE I thought they were mapped to... I must have screwed something up while working on it... Once I straightened out my mapping - the shadows came back... I was using the "1" on the alpha priority... In the attached example - I just fixed the main body - that's why the shadow for the trucks/bogies are missing... Appreciate all the help folks - sorry for the confusion - and - at least it helped identify a bug...
:bigboss:


Attached Image: Image5.jpg

Regards,
Scott

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users