BVE: Strange transparency problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tof63
    Senior Member
    • Apr 2003
    • 392
    • Turin, Italy.

    #1

    BVE: Strange transparency problem

    Missing Attachment... says the page showed by the link...

    Luigi Cartello


    Luigi Cartello

    http://bve.altervista.org
  • Stooopid_person
    1500 Post Veteran
    • Nov 1999
    • 1592
    • Planet Stooopid.

    #2
    RE: Strange transparency problem

    >Missing Attachment... says the page showed by the link...

    Corrected.

    Comment

    • Technical Numpty
      Senior Member
      • Apr 2003
      • 194
      • Essex, UK.

      #3
      RE: Strange transparency problem

      Hi Stoopid,

      You've checked the basics I presume (bitmap size, pure colour, etc)...? When I last had transparency problems, it was down to a bitmap not being the correct size, although the problem wasn't as complex as this one.

      Another thought I've just had. Is the object bang on a 25 metre line? I've got a rake of coaches on a route I'm building and the one before last always disappears before you get fully past it. I know it's nothing to do with the 25 metre unload feature, as the object is less than 25 metres in length and not projected back at all. However, it disappears when you get to exactly 100 metres (I think). I'm not too bothered about this, as the rake is not in the correct position anyway, but I can't explain why it happens either.

      Technical Numpty

      Comment

      • Bryan88
        Member
        • Apr 2003
        • 61
        • High Wycombe, U.K.

        #4
        RE: Strange transparency problem


        >
        >Another thought I've just had. Is the object bang on a 25
        >metre line? I've got a rake of coaches on a route I'm
        >building and the one before last always disappears before
        >you get fully past it.

        Hi,

        TN has really summed up all the problems associated with this effect.

        Was the original graphic "converted down" to 256 colors? if yes then the transparency color has changed.

        Redo the transparency color fill and also check that it matches this color as listed in the the object file (b3d/csv).

        Hope it clears up for you

        Cheers
        Bryan

        Comment

        • Stooopid_person
          1500 Post Veteran
          • Nov 1999
          • 1592
          • Planet Stooopid.

          #5
          RE: Strange transparency problem

          >Hi Stoopid,
          >
          >You've checked the basics I presume (bitmap size, pure
          >colour, etc)...? When I last had transparency problems, it
          >was down to a bitmap not being the correct size, although
          >the problem wasn't as complex as this one.
          >
          >Another thought I've just had. Is the object bang on a 25
          >metre line? I've got a rake of coaches on a route I'm
          >building and the one before last always disappears before
          >you get fully past it. I know it's nothing to do with the 25
          >metre unload feature, as the object is less than 25 metres
          >in length and not projected back at all. However, it
          >disappears when you get to exactly 100 metres (I think). I'm
          >not too bothered about this, as the rake is not in the
          >correct position anyway, but I can't explain why it happens
          >either.

          Yes, it is on a 25m line. Yes the bitmap is 256x256, 24 bit. As said, it only seems to be on this object, and one other object. There are also lots more object that uses this bitmap, as stated above, I also tried copying the code for the round entrance from another file, which has no problems, to this one.

          If there were really transparency problems, then in the first place, it wouldn't be transparent at some anlges, it would be opaque at all angles! And other objects which uses this bitmap won't work as well!

          Your object might be less than 25m, but the last part of the car might stretch to more than 25m like for exmaple your car is 20m long and placed at distance, 1010. So at 1025, the obejct will unload, even though your object stretches till 1030m.

          Comment

          • ferrovipathe
            Senior Member
            • Apr 2003
            • 169
            • Paris, France.

            #6
            RE: Strange transparency problem

            Hi !

            Where is the begining (the first vertex) of the bit map?
            Is it in the same place than the first vextex of your object ?
            Aren't you drawing one thing in clockwise direction, and an other in the opposite?
            Is your object square ?

            Sometime, that's enought to do such transparency's problem.

            I get some like that with my viaduc's object, when I was trying to put a square bitmap on a non square object, or begining object's face on left/up vertex, and bitmap on left/down.

            I think it's a problem like that. Visual basic is sometime, with DirectX, a mystery...

            All the best.

            Comment

            • Wulf_9
              Senior Member
              • Apr 2003
              • 520
              • Norwich, UK

              #7
              RE: Strange transparency problem

              Welcome back Jean-Louis, I hope you feel refreshed and calmer now

              Would you allow Loop to be available please, I can add it to the routes section at SLW if you like... it's too good to keep hidden away

              Wulf

              Saxon Locomotive Works - "The difficult we do immediately; the impossible takes a little longer"


              'Time flies like an arrow; fruit flies like a banana' ~Groucho Marx

              Comment

              • Stooopid_person
                1500 Post Veteran
                • Nov 1999
                • 1592
                • Planet Stooopid.

                #8
                RE: Strange transparency problem

                >Hi !
                >
                >Where is the begining (the first vertex) of the bit map?
                >Is it in the same place than the first vextex of your object
                >?
                >Aren't you drawing one thing in clockwise direction, and an
                >other in the opposite?
                >Is your object square ?

                Here's the code
                But by itself, it doesn't cause any problems.

                CreateMeshbuilder,,,,
                AddVertex, -3, -0.9, 25,
                AddVertex, -3, 4.9, 25,
                AddVertex, 3, 4.9, 25,
                AddVertex, 3, -0.9, 25,
                AddFace, 0,1,2,3,
                SetColor, 255,255,225,
                GenerateNormals,,,,

                LoadTexture,Tun_Ent_S.bmp, ;the round entrance
                SettextureCoordinates, 0, 0, 1,
                SettextureCoordinates, 1, 0, 0,
                SettextureCoordinates, 2, 1, 0,
                SettextureCoordinates, 3, 1, 1,
                SetdecalTransparentcolor, 0,0,0,

                Comment

                • Stooopid_person
                  1500 Post Veteran
                  • Nov 1999
                  • 1592
                  • Planet Stooopid.

                  #9
                  RE: Strange transparency problem

                  Oh, and I have tried modifying from 24 bit to 256 colours, but still the same problem. All other objects that uses this bitmap and code work okay except one more and this one.

                  Comment

                  • ferrovipathe
                    Senior Member
                    • Apr 2003
                    • 169
                    • Paris, France.

                    #10
                    RE: Strange transparency problem

                    Try

                    LoadTexture,Tun_Ent_S.bmp, ;the round entrance
                    SettextureCoordinates, 0, 0, 0,
                    SettextureCoordinates, 1, 0, 1,
                    SettextureCoordinates, 2, 1, 1,
                    SettextureCoordinates, 3, 1, 0,
                    SetdecalTransparentcolor, 0,0,0,


                    because begining of the face and bitmap are not the same. That's the only thing I find witch can make directdraw hanging.

                    Comment

                    • cjh401
                      Senior Member
                      • Jul 2003
                      • 139
                      • .

                      #11
                      RE: Strange transparency problem

                      >Try
                      >
                      >LoadTexture,Tun_Ent_S.bmp, ;the round entrance
                      >SettextureCoordinates, 0, 0, 0,
                      >SettextureCoordinates, 1, 0, 1,
                      >SettextureCoordinates, 2, 1, 1,
                      >SettextureCoordinates, 3, 1, 0,
                      >SetdecalTransparentcolor, 0,0,0,
                      >
                      >
                      >because begining of the face and bitmap are not the same.
                      >That's the only thing I find witch can make directdraw
                      >hanging.

                      As far as I can tell, this should only serve to reflect the bmp image on the surface... but who knows. Modern technology eh??

                      As for the original problem, I had similar difficulties with the 455 objects, with the transparancy failing as you passed the coach, but I fiddled my way out of it so I did not have to solve the problem. It was certain angles that it turned up in. I think at the time I put it down to the fact that the face was pointing along the track not towards the train (for multiobj purpose), but as I said I did not solve it, I just split it into 2 separate objects and it worked.


                      Comment

                      • Stooopid_person
                        1500 Post Veteran
                        • Nov 1999
                        • 1592
                        • Planet Stooopid.

                        #12
                        RE: Strange transparency problem

                        >As far as I can tell, this should only serve to reflect the
                        >bmp image on the surface... but who knows. Modern technology
                        >eh??

                        Yes, it only makes it upside down, but even if it is upside down, the problem is still there!

                        Comment

                        • Stooopid_person
                          1500 Post Veteran
                          • Nov 1999
                          • 1592
                          • Planet Stooopid.

                          #13
                          RE: Strange transparency problem

                          How to solve
                          Either I remove these together(removing only one will not solve the problem and removing other meshbuilder sections will not help as well).
                          CreateMeshBuilder,
                          AddVertex,5.9,-0.3,18,
                          AddVertex,5.9,-0.3,25.3,
                          AddVertex,5.9,6,25.3,
                          AddVertex,5.9,6,18,
                          AddFace,0,1,2,3,
                          SetColor,255,255,225,
                          GenerateNormals,

                          CreateMeshBuilder,
                          AddVertex, 3, -0.3, 18,
                          AddVertex, 6, -0.3, 18,
                          AddVertex, 6,5, 18,
                          AddVertex, 3,5, 18,
                          AddFace, 3,2,1,0,
                          SetColor, 255,255,225,
                          GenerateNormals,

                          OR

                          I remove(using another texture does not help)
                          LoadTexture,xxx.bmp,
                          SetTextureCoordinates,22,0,0,
                          SetTextureCoordinates,23,1,0,
                          SetTextureCoordinates,24,0,0.125,
                          SetTextureCoordinates,25,1,0.125,
                          SetTextureCoordinates,26,0,0.25,
                          SetTextureCoordinates,27,1,0.25,
                          SetTextureCoordinates,28,0,0.375,
                          SetTextureCoordinates,29,1,0.375,
                          SetTextureCoordinates,30,0,0.5,
                          SetTextureCoordinates,31,1,0.5,
                          SetTextureCoordinates,32,0,0.625,
                          SetTextureCoordinates,33,1,0.625,
                          SetTextureCoordinates,34,0,0.75,
                          SetTextureCoordinates,35,1,0.75,
                          SetTextureCoordinates,36,0,0.875,
                          SetTextureCoordinates,37,1,0.875,
                          SetTextureCoordinates,38,0,1,
                          SetTextureCoordinates,39,1,1,
                          SetDecalTransparentColor,0,255,0,

                          The texture part works perfectly for other objects, but I haven't tested whether the two meshbuilder part works for other objects.

                          Comment

                          • ferrovipathe
                            Senior Member
                            • Apr 2003
                            • 169
                            • Paris, France.

                            #14
                            RE: Strange transparency problem

                            Hi!

                            It's quite impossible to help you more if you don't post us all the object's source. That's one seems to be a lot complex, and I am not able to understand where is the mistaking without listing. (And also I can't try it). It is the same thing as repearing a car by phone.

                            All the best.

                            N.B. I think we don't need bitmap; just post size and color's coding.

                            Comment

                            • Wulf_9
                              Senior Member
                              • Apr 2003
                              • 520
                              • Norwich, UK

                              #15
                              RE: Strange transparency problem

                              my post above? Would be nice if you acknowledge it at least

                              Saxon Locomotive Works - "The difficult we do immediately; the impossible takes a little longer"


                              'Time flies like an arrow; fruit flies like a banana' ~Groucho Marx

                              Comment

                              Working...