Results 1 to 7 of 7

Thread: Color in TextureMap incorrect ?

  1. #1

    Color in TextureMap incorrect ?

    I updated my engine with the new asphyre components. All works fine except the color using the TextureMap function.
    When I use $FF000000 it should be black but it is alwayy the normal color.
    Is this a bug or does the color work different form the last version ?

  2. #2

    Color in TextureMap incorrect ?

    What effect do you use? Remember that to use the diffuse color you should use "effectDiffuse" in addition to any other effects. And if you already do this, what value do you pass to TextureMap function? And do you use use the latest release?

  3. #3

    Color in TextureMap incorrect ?

    I use the latest release. i want to draw a shadow of the items in my level.
    I use cColor1($FF000000) and effectSrcAlpha.
    With powerDraw3 this worked but with the new version it is always drawn without changing the color.
    Only alpha value of the color has an effect.
    here is the main part of my drawing method:
    [pascal]
    procedure TMCDirectXEngine.drawImage(p_iX, p_iY, p_iImageIndex, p_iPatternIndex : integer; p_bAlpha : boolean; p_bFlip : boolean; p_iAngle : integer; p_iScale : integer; p_iColor : Cardinal; p_bAdd : boolean; p_bMirror : Boolean);
    var
    oImage: TAsphyreImage;
    oPos: TPoint4;
    iEffect: integer;
    begin
    // ...
    if p_iAngle <> 0 then
    oPos := pRotate4c(p_iX, p_iY, oImage.PatternWidth, oImage.PatternHeight, p_iAngle)
    else
    oPos := pBounds4(p_iX, p_iY, oImage.PatternWidth, oImage.PatternHeight);

    if p_iScale <> 0 then
    if p_iAngle<> 0 then
    oPos:= pRotate4sc(p_iX, p_iY, oImage.PatternWidth, oImage.PatternHeight, p_iAngle, p_iScale)
    else
    oPos := pBounds4s(p_iX, p_iY, oImage.PatternWidth, oImage.PatternHeight, p_iScale);

    iEffect := effectNone;

    if (p_bAlpha) then
    iEffect := iEffect or effectSrcAlpha;

    if (p_bAdd) then
    begin
    iEffect := iEffect or effectDiffuse or effectSrcAlpha;
    end;
    m_oPowerDraw.Device.TextureMap(oImage, oPos, cColor1(p_iColor), tPatternEx(p_iPatternIndex, p_bMirror, p_bFlip), iEffect);
    end;

    [/pascal]

  4. #4

    Color in TextureMap incorrect ?

    Greetings! It's seems very odd and if the color is left unchanged, does this have the same effects on fonts and everything else? (if it's a problem in Asphyre, then all fonts should appear in white color only). Does the same problem occur if you use Software Renderer? Although I possess newer version that the one released - I couldn't reproduce this artifact - diffuse color works as it should. If you still believe the problem is in Asphyre, then please give more detailed info on the image format you using, display mode, etc... and an example would be nice!
    Thanks,
    Lifepower

  5. #5

    Color in TextureMap incorrect ?

    I have spotted this as well. I the newest version (asphyre-pre.exe), it no longer uses the color unless effectDiffuse used.

    in the asphyre_exp2.exe version i could just use
    TextureMap( . , . ,cColor1($FF00FF00), . ,effectSrcAlpha);

    and now i have to use
    TextureMap( . , . ,cColor1($FF00FF00), . ,effectSrcAlpha or effectDiffuse);
    to get the color applied

  6. #6

    Color in TextureMap incorrect ?

    This was probably a bug in previous versions which was corrected. In previous versions the diffuse color was ALWAYS used, no matter what, even though it was assumed that you had to specify "effectDiffuse" in order to use the diffuse color. I found this bug recently and now you effectively need to use effectDiffuse parameter.

  7. #7

    Color in TextureMap incorrect ?

    Thanx, with effectDiffuse it works fine.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •