Bienvenue sur Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
Recherche
6 visiteur(s) et 0 membre(s) en ligne.
 
 
    Annonces Google

    Petites Annonces

il y a annonces
    Liens

Toutes les informations sur :
  • Amiga OS 4:
    AmigaOS.net
  • Logiciels pour OS4 :
    OS4depot
  • Matériel Amiga :
    ACube Systems
  • Magazine papier :
    AmigaPower
  • Magazine en ligne :
    Obligement
  •     Activité du Site

    Pages vues depuis 25/07/2007 : 105 691
    • Nb. de Membres : 171
    • Nb. d'Articles : 1 038
    • Nb. de Forums : 17
    • Nb. de Sujets : 16
    • Nb. de Critiques : 19

    Top 10  Statistiques

      
    Utilisation de CompositeTag

    (4394 mots dans ce texte )  -   lu : 2500 Fois     Page Spéciale pour impression

    Utilisation du mode de composition d'AmigaOS 4.1

    Alain Thellier nous explique l'utilisation du mode de composition d'AmigaOS 4.1.


    CompositeTags marche de 2 manières:

    1) Comme le blitter il utilise des surfaces rectangulaires (genre x y haut large) et les blitte avec transparence alpha dans une autre bitmap
    ==> je n'ai jamais utilisé cette façon de faire

    2) Il trace des triangles de forme quelconque venant d'une bitmap dans une autre bitmap avec transparence.C'est pratiquement identique à ce que fait OpenGL (ou Warp3D) avec :
    glVertexPointer(...);
    glTexCoordPointer(...);
    glDrawArrays(GL_TRIANGLES,0,TRInb*3);
    Voir une doc GL si besoin....

    C'est ce que j'utilise dans CompositePOC (en combinant 2 triangles pour tracer un rectangle) et me permet de les mettre dans N'IMPORTE quelle position,les tourner, les mettre de biais, les redimensionner, etc....

    Donc P contient le tableau avec les coordonnées x y des points des tris

    TRInb le nombre de triangles (2 pour simuler un rectangle)

    COMPVF_STW0_Present indique que les coordonnées de textures s t w sont fournies aussi (similaire au u v w d'OpenGL mais dans l'espace pixels et non pas 0.0 à 1.0 )
    struct XYSTW_Vertex3D {
    float x, y;
    float s, t, w;
    };

    NAME
    CompositeTagList - Compose one bitmap onto another (V53)

    SYNOPSIS
    uint32 CompositeTagList(uint32 operator, struct BitMap *Source,
    struct BitMap *Dest, struct TagItem *tags);

    uint32 CompositeTags(uint32 operator, struct BitMap *Source,
    struct BitMap *Dest, ...);

    FUNCTION
    This function implements Porter/Duff image compositing. If possible,the operation will be hardware accelerated.

    The function composes the bitmap pointed to by Source onto the bitmappointed to by Dest, using the specified operator.

    Color values in the bitmaps are pre-multiplied with the alpha values(or left unmodified if no alpha is present) before composition. Themost common operator is COMPOSITE_Src_Over_Dest, which, if thedestination's alpha value is 1, performs a standard OpenGL-stylelinear blend between the Source and Destination bitmaps based on thesource alpha values (i.e. a "transparent blit").

    For the purpose of the operation, this is the order in which themodifiers are applied:

    - The source rectangle specifies a sub-portion of the source bitmapthat becomes the source operand. Note that ONLY the sourcerectangle is used for this, i.e for all intent and purpose thisis equivalent to specifying a bitmap that only contains the pixelsin the source rectangle.

    - The destination operand is ALWAYS the complete destination bitmap.However, no pixel outside the destination rectangle is modified.Likewise, the OffsetX and OffsetY values specify coordinatesrelative to the top left pixel of the destination bitmap, NOTthe destination rectangle.

    - The scale factors are applied after the source rectangle is "cut"from the source bitmap. This enlarges or shrinks the sourceoperand to a new size, doubling or removing pixels as needed, andpossibly filtering them. For all intent and purpose this isequivalent to providing a bitmap that contains a scaled (andpossibly filtered) image of the original source rectangle.

    - After scaling, the resulting pixels are composed into thedestination bitmap one by one using the specified operator. Asmentioned previously, no pixel outside the destination bitmap'sdestination rectangle are modified; the result of the composeoperation there is discarded (this process is commonly called"clipping", although the term "sciscoring" is more adequate).

    - Exactly the same method is used for any alpha mask specified.

    Please refer to the SDK documentation and example code for a morein-depth discussion of the function and Porter/Duff style imagecomposition in general.

    INPUTS
    operator - the Porter/Duff image composition operator. Please refer tographics/composite.h for a list of operators, and the SDKdocumentation for their meaning.

    Source - The source bitmap. The bitmap may or may not have an Alphachannel. If it hasn't got one, then an alpha of one is assumed.The tag items may influence the interpretation of the alpha channelas well. The bitmap must be BMF_DISPLAYABLE to be able to usehardware acceleration, and it must be a compatible format, otherwisesoftware blending is used.

    Dest - The destination bitmap. The same restrictions apply as with theSource bitmap.

    tags - A tag list with additional parameters.Some of the tag items accept fix point real numbers. These are32 bit integers with the upper 16 bit representing the decimalpart of the number, and the lower 16 bits representing thefractional part. To convert from a float to a fixpoint number,simply multiply 0x00010000 by the floating point number andtypecast the result to an int32.

    Currently, the following tag items are possible:

    COMPTAG_SrcX (uint32)

    The X coordinate of a subrectangle on the sourcebitmap. If a subrectangle is specified, only that part of thebitmap is used for the compositing operation. Default is 0.

    COMPTAG_SrcY (uint32)

    The Y coordinate of a subrectangle on the sourcebitmap. If a subrectangle is specified, only that part of thebitmap is used for the compositing operation. Default is 0.

    COMPTAG_SrcWidth (uint32)

    The width of a subrectangle on the sourcebitmap. If a subrectangle is specified, only that part of thebitmap is used for the compositing operation. Default is thewidth of the source bitmap.

    COMPTAG_SrcHeight (uint32)

    The height of a subrectangle on the sourcebitmap. If a subrectangle is specified, only that part of thebitmap is used for the compositing operation. Default is theheight of the source bitmap.

    COMPTAG_DestX (uint32)

    The X coordinate of a subrectangle on thedestination bitmap. This rectangle specifies the area of thebitmap that is affected by the operation. In no case are pixelsoutside of this area affected by the operation. Default is 0.

    COMPTAG_DestY (uint32)

    The Y coordinate of a subrectangle on thedestination bitmap. This rectangle specifies the area of thebitmap that is affected by the operation. In no case are pixelsoutside of this area affected by theoperation. Default is 0.

    COMPTAG_DestWidth (uint32)

    The width of a subrectangle on thedestination bitmap. This rectangle specifies the area of thebitmap that is affected by the operation. In no case are pixelsoutside of this area affected by the operation. Default is thewidth of the destination bitmap.

    COMPTAG_DestHeight (uint32)

    The height of a subrectangle on thedestination bitmap. This rectangle specifies the area of thebitmap that is affected by the operation. In no case are pixelsoutside of this area affected by the operation. Default is theheight of the destination bitmap.

    COMPTAG_SrcAlpha (fixpoint)

    A constant alpha factor for the source bitmap.If the COMPFLAG_SrcAlphaOverride flag is given (see below) thisvalue replaces any alpha channel or mask that may be present inthe bitmap itself or specified via a tag item. If theCOMPFLAG_SrcAlphaOverride flag is not given, then the alphachannel of the source bitmap is multiplied with this value. Thistag can be used to implement the Porter/Duff fade and darkenoperators. The default value is 1.0. Setting any value outsidethe interval of zero to one inclusive yields undefined results.

    COMPTAG_DestAlpha (fixpoint)

    A constant alpha factor for the destination bitmap.If the COMPFLAG_DestAlphaOverride flag is given (see below) thisvalue replaces any alpha channel or mask that may be present inthe bitmap itself or specified via a tag item. If theCOMPFLAG_DestAlphaOverride flag is not given, then the alphachannel of the source bitmap is multiplied with this value. Thistag can be used to implement the Porter/Duff fade and darkenoperators. The default value is 1.0f. Setting any value outsidethe interval of zero to one inclusive yields undefined results.

    COMPTAG_ScaleX (fixpoint)

    A floating-point scale factor by which the source bitmap resp.the subrectangle of the source bitmap should be scaledhorizontally before the operation is executed. A value of 1.0fmeans no scaling. Values greater than one enlarge the bitmap,while values between zero and one shrink it. Values less thanor equal to zero are illegal and will result in the function tofail. Defaults to 1.0f (no scaling)

    COMPTAG_ScaleY (fixpoint)

    A floating-point scale factor by which the source bitmap resp.the subrectangle of the source bitmap should be scaledvertically before the operation is executed. A value of 1.0fmeans no scaling. Values greater than one enlarge the bitmap,while values between zero and one shrink it. Values less thanor equal to zero are illegal and will result in the function tofail. Defaults to 1.0f (no scaling)

    COMPTAG_SrcAlphaMask (struct BitMap *)

    A pointer to an (alternative) alpha channel for the sourcebitmap. If specified, alpha information in the source bitmapis ignored.

    COMPTAG_DestAlphaMask (struct BitMap *)

    A pointer to an (alternative) alpha channel for the destinationbitmap. If specified, alpha information in the destinationis ignored.

    COMPTAG_SrcAlphaX (uint32)
    COMPTAG_SrcAlphaY (uint32)

    The X and Y coordinates of a subrectangle on the alpha channelbitmap for the source. The width and height of the rectangleare the same as the COMPTAG_SrcWidth and COMPTAG_SrcHeight.Defaults to zero.

    COMPTAG_DestAlphaX (uint32)
    COMPTAG_DestAlphaY (uint32)

    The X and Y coordinates of a subrectangle on the alpha channelbitmap for the destination. The width and height of therectangle are the same as the COMPTAG_SrcWidth andCOMPTAG_SrcHeight.Defaults to zero.

    COMPTAG_Flags (uint32)

    A bit mask specifying a number of flag bits that further modifythe operation of this call. Currently, the following flags aredefined:

    COMPFLAG_SrcAlphaOverride
    COMPFLAG_DestAlphaOverride
    If either is set, the source respectively destinationalpha factor specified with COMPTAG_SrcAlpha resp.COMPTAG_DestAlpha overrides the alpha value in thebitmap or alpha mask, i.e. the alpha channel is assumedto be a constant value as specified. If the respectivebit is not set, source resp. destination alpha channelvalues are multiplied with the value specified by theCOMPTAG_SrcAlpha/COMPTAG_DestAlpha tag.

    COMPFLAG_SrcFilter
    If set, then bilinear filtering is applied to thesource bitmap to smooth out any artifacts introducedby scaling. Filtering will have a slight but negligibleperformance impact on hardware acceleration (usuallythis will be so small it cannot be noticed), but mighthave a severe impact when using software. The softwareimplementation may ignore this flag.

    COMPFLAG_HardwareOnly
    If this flag is set and the operation cannot beperformed in hardware, instead of falling back tosoftware the operation will fail entirely.*

    COMPFLAG_IgnoreDestAlpha
    If this flag is set, the destination bitmap is assumedto be without alpha channel, i.e. Alpha is assumed tobe one. On some hardware this greatly enhances theperformance or reduces the overhead of the function(for example, it frees the R200 driver from allocatingtemporary texture storage). Use this flag wheneverpossible.

    COMPTAG_OffsetX (int32)
    COMPTAG_OffsetY (int32)

    Specifies the offset on the destination bitmap (NOT thedestination rectangle) where the source operand should beapplied. Negative coordinates are possible. By default, bothtags are zero.


    RESULT
    The function returns a status code. The following values are possible:

    COMPERR_Success
    No error. The operation performed successfully.

    COMPERR_Incompatible
    The input bitmaps were incompatible for the call. This usuallyhappens when a bitmap color format is not supported.

    COMPERR_Value
    An input value was illegal. This error is raised if e.g. thespecified operator is not known, or negative coordinates aregiven, etc.

    COMPERR_SoftwareFallback
    The COMPFLAG_HardwareOnly flag was set but the operation wasincompatible with the current hardware.

    COMPERR_OutOfMemory
    Temporary storage was required to finish the operation but couldnot be allocated.

    COMPERR_Generic
    An unknown error has occurred.

    SEE ALSO
    SDK examples and documentation.

    enum enPDOperator
    {
    COMPOSITE_Clear = 0,
    COMPOSITE_Src = 1,
    COMPOSITE_Dest = 2,
    COMPOSITE_Src_Over_Dest = 3,
    COMPOSITE_Dest_Over_Src = 4,
    COMPOSITE_Src_In_Dest = 5,
    COMPOSITE_Dest_In_Src = 6,
    COMPOSITE_Src_Out_Dest = 7,
    COMPOSITE_Dest_Out_Src = 8,
    COMPOSITE_Src_Atop_Dest = 9,
    COMPOSITE_Dest_Atop_Src = 10,
    COMPOSITE_Src_Xor_Dest = 11,
    COMPOSITE_Plus = 12,

    COMPOSITE_NumOperators = 13
    };

    /* Tag items for the Composite call */
    #define COMPTAG_Base TAG_USER

    /* (uint32) X clip coordinate on source bitmap (defaults to 0) */
    #define COMPTAG_SrcX (COMPTAG_Base + 0)

    /* (uint32) Y clip coordinate on source bitmap (defaults to 0) */
    #define COMPTAG_SrcY (COMPTAG_Base + 1)

    /* (uint32) Width of clip rectangle on source (defaults to full width) */
    #define COMPTAG_SrcWidth (COMPTAG_Base + 2)

    /* (uint32) Height of clip rectangle on source (defaults to full height) */
    #define COMPTAG_SrcHeight (COMPTAG_Base + 3)

    /* (uint32) X clip coordinate on dest bitmap (defaults to 0) */
    #define COMPTAG_DestX (COMPTAG_Base + 4)

    /* (uint32) Y clip coordinate on dest bitmap (defaults to 0) */
    #define COMPTAG_DestY (COMPTAG_Base + 5)

    /* (uint32) Width of clip rectangle on dest (defaults to full width) */
    #define COMPTAG_DestWidth (COMPTAG_Base + 6)

    /* (uint32) Height of clip rectangle on dest (defaults to full height) */
    #define COMPTAG_DestHeight (COMPTAG_Base + 7)

    /* (fixpoint) (additional) Alpha for source bitmap (no default) */
    #define COMPTAG_SrcAlpha (COMPTAG_Base + 8)

    /* (fixpoint) (additional) Alpha for destination bitmap (no default) */
    #define COMPTAG_DestAlpha (COMPTAG_Base + 9)

    /* (fixpoint) X scale factor for source bitmap (defaults to 1.0) */
    #define COMPTAG_ScaleX (COMPTAG_Base + 10)

    /* (fixpoint) Y scale factor for source bitmap (defaults to 1.0) */
    #define COMPTAG_ScaleY (COMPTAG_Base + 11)

    /* (struct Bitmap *) Alpha mask for source. Specifying this tag overrides any
    * alpha that might be present in the source bitmap.
    */
    #define COMPTAG_SrcAlphaMask (COMPTAG_Base + 12)

    /* (struct Bitmap *) Alpha mask for the destination. Specifying this tag
    * overrides any alpha that might be present in the destination bitmap.
    */
    #define COMPTAG_DestAlphaMask (COMPTAG_Base + 13)

    /* (uint32, see defines below) Specifies a set of flags that may modify the
    * operation. See the defines below
    */
    #define COMPTAG_Flags (COMPTAG_Base + 18)

    /* (int32) X Coordinate on the destination bitmap that the operation should be
    * applied to. Defaults to zero.
    */
    #define COMPTAG_OffsetX (COMPTAG_Base + 20)

    /* (int32) Y Coordinate on the destination bitmap that the operation should be
    * applied to. Defaults to zero.
    */
    #define COMPTAG_OffsetY (COMPTAG_Base + 21)

    /* (struct BitMap *) when the source and/or destination bitmaps are located in
    * main memory, this tag tells the graphics system to upload the bitmaps to
    * the same board the friend bitmap is located on.
    */
    #define COMPTAG_FriendBitMap (COMPTAG_Base + 22)

    /* (uint32) the same as above, but a DisplayID is used as reference to the board
    * and not a bitmap.
    */
    #define COMPTAG_DisplayID (COMPTAG_Base + 23)

    /* (uint32) the X/Y coordinates on the src alpha map to use for compositing. If not
    * specified, use the same as the SrcX and SrcY
    */
    #define COMPTAG_SrcAlphaX (COMPTAG_Base + 14)
    #define COMPTAG_SrcAlphaY (COMPTAG_Base + 15)

    /* (uint32) the X/Y coordinates on the destination alpha map to use. If not
    * specified, use the DestX and DestY
    */
    #define COMPTAG_DestAlphaX (COMPTAG_Base + 16)
    #define COMPTAG_DestAlphaY (COMPTAG_Base + 17)

    /*
    * The following group of tag items deals with direct triangle mapping. Read the
    * autodoc for a detailed explanation
    */
    #define COMPTAG_VertexArray (COMPTAG_Base + 30)
    #define COMPTAG_IndexArray (COMPTAG_Base + 31)
    #define COMPTAG_VertexFormat (COMPTAG_Base + 32)
    #define COMPTAG_NumTriangles (COMPTAG_Base + 33)

    /*
    * This group of tag items can be used to specify up to four colors, either
    * as an 32 bit ARGB value, or as a set of discreet fixpoint numbers.
    *
    * The fixpoint numbers range is 0 to 1. Specifying a fixpoint component
    * overrides the ARGB value completely.
    */
    #define COMPTAG_Color0 (COMPTAG_Base + 40)
    #define COMPTAG_Color1 (COMPTAG_Base + 41)
    #define COMPTAG_Color2 (COMPTAG_Base + 42)
    #define COMPTAG_Color3 (COMPTAG_Base + 43)

    #define COMPTAG_Color0_Red (COMPTAG_Base + 44)
    #define COMPTAG_Color0_Green (COMPTAG_Base + 45)
    #define COMPTAG_Color0_Blue (COMPTAG_Base + 46)
    #define COMPTAG_Color0_Alpha (COMPTAG_Base + 47)

    #define COMPTAG_Color1_Red (COMPTAG_Base + 48)
    #define COMPTAG_Color1_Green (COMPTAG_Base + 49)
    #define COMPTAG_Color1_Blue (COMPTAG_Base + 50)
    #define COMPTAG_Color1_Alpha (COMPTAG_Base + 51)

    #define COMPTAG_Color2_Red (COMPTAG_Base + 52)
    #define COMPTAG_Color2_Green (COMPTAG_Base + 53)
    #define COMPTAG_Color2_Blue (COMPTAG_Base + 54)
    #define COMPTAG_Color2_Alpha (COMPTAG_Base + 55)

    #define COMPTAG_Color3_Red (COMPTAG_Base + 56)
    #define COMPTAG_Color3_Green (COMPTAG_Base + 57)
    #define COMPTAG_Color3_Blue (COMPTAG_Base + 58)
    #define COMPTAG_Color3_Alpha (COMPTAG_Base + 59)


    /*
    * Reserved
    */
    #define COMPTAG_Private (COMPTAG_Base + 34)
    #define COMPTAG_Private2 (COMPTAG_Base + 35)

    /* Vertex Array format flags */
    #define COMPVF_STW0_Present 0x02
    #define COMPVF_STW1_Present 0x04

    /*
    * Flags for the COMPTAG_Flags tag item
    *
    * Currently defined flags are:
    * COMPFLAG_SrcAlphaOverride - If set, the value specified in SrcAlpha overrides
    * the value in the source bitmap, which means that the source bitmap is
    * assumed to have a constant alpha over the entire image. If not set,
    * the SrcAlpha value is used to modulate/scale any other alpha channel.
    * COMPFLAG_DestAlphaOverride - Like COMPFLAG_SrcAlphaOverride, for the
    * destination bitmap.
    * COMPFLAG_SrcFilter - If set, enables bilinear filtering of the source bitmap
    * while scaling. While this can improve the quality of scaled images,
    * it might cause a dramatic slowdown when the operation is emulated
    * in software.
    * COMPFLAG_DestFilter - Like COMPFLAG_SrcFilter for the destination bitmap.
    * COMPFLAG_HardwareOnly - If set, the call will fail with an error code if
    * the operation cannot be performed in hardware. Reasons for this !include!
    * software-only bitmaps, unsupported color formats, etc.
    * COMPFLAG_ForceSoftware - If set, the operation will be emulated in software
    * even if it could be performed in hardware. This is mostly useful for
    * testing purposes. Setting this overrides COMPFLAG_HardwareOnly.
    * COMPFLAG_Color1Modulate - If set, then Color 1 is used as a modulate
    * color for the src bitmap. That is, each color component of each pixel
    * in the source bitmap is multiplied with the color 1 (including its
    * alpha). All other effects stay in effect. This flag can essentially
    * be used to "tint" a bitmap in the given color
    */

    #define COMPFLAG_SrcAlphaOverride (1L << 0)
    #define COMPFLAG_DestAlphaOverride (1L << 1)
    #define COMPFLAG_SrcFilter (1L << 2)
    #define COMPFLAG_HardwareOnly (1L << 3)
    #define COMPFLAG_IgnoreDestAlpha (1L << 4)
    #define COMPFLAG_ForceSoftware (1L << 7)
    #define COMPFLAG_Color1Modulate (1L << 8)

    /* Helper Macros to convert to/from fixpoint numbers */
    #define COMP_FIX_ONE 0x00010000
    #define COMP_FLOAT_TO_FIX(f) (int32)((float)COMP_FIX_ONE * f)
    #define COMP_FIX_TO_FLOAT(fix) ((float)fix / (float)COMP_FIX_ONE)
    #define COMP_FIX_TO_UINT32(fix) ((fix) / COMP_FIX_ONE)


    /* Possible constants for Source */
    #define COMPSRC_SOLIDCOLOR ((struct BitMap *)1)

    enum enCompositeError
    {
    COMPERR_Success = 0,
    COMPERR_Incompatible = 1, /* Incompatible bitmaps for operation */
    COMPERR_Value = 2, /* An input value is out of range */
    COMPERR_SoftwareFallback = 3, /* Operation would fall back to
    software emulation and hardware
    only was requested */
    COMPERR_OutOfMemory = 4, /* The operation tried to allocate
    memory but failed */
    COMPERR_Generic = 5, /* Some generic error has occurred */
    COMPERR_UnknownOperator = 6, /* Unknown operator specified */
    COMPERR_MissingInput = 7, /* Missing a mandatory tag item */

    };

    Il existe un possible bug qui empêche l'utilisation d'un écran comme bitmap source.

    La technique 2 permet juste de positionner le rectangle dans n'importe quelle position ce qui est coolissime (ou alors de tracer des tonnes de triangles 3D pour faire un rendu 3D comme fait Wazp3D).Le plus simple est alors de reprendre du code qui marche à CompositePOC.Pour un rectangle normal on peut se contenter de la 1) mais je l'ai jamais utilisée...

    Sur P96 j'ai fait comme l'exemple de Hans avec la boing ball = pas d'avis

    Concernant les opérateurs alpha :

    1) Sur la doc sur l'Alpha compositing, ce que l'on trouve sur Internet est en dessous de tout (= de zolis dessins mais pas de formules math.). Et dans le SDK y a pas grand choses non plus.Voici ce que j'ai trouvé d'utile:

    Donc Os4 supporte les opérations suivantes :
    Clear
    Src
    Dest
    Src_Over_Dest
    Dest_Over_Src
    Src_In_Dest
    Dest_In_Src
    Src_Out_Dest
    Dest_Out_Src
    Src_Atop_Dest
    Dest_Atop_Src
    Src_Xor_Dest
    Plus

    Avec cette page j'ai obtenu qques formules :

    ADD Saturate(S + D)
    CLEAR DstA= 0 DstC= 0;
    DARKEN DstA= SrcA + DstA - SrcA*DstA DstC= SrcC*(1 - DstA) + DstC*(1 - SrcA) + min(SrcC,DstC);
    DST DstA= DstA DstC= DstC;
    DST_ATOP DstA= SrcA DstC= SrcA * DstC + SrcC * (1 - DstA);
    DST_IN DstA= SrcA * DstA DstC= SrcA * DstC;
    DST_OUT DstA= DstA * (1 - SrcA) DstC= DstC * (1 - SrcA);
    DST_OVER DstA= SrcA + (1 - SrcA)*DstA DstC= Rc = DstC + (1 - DstA)*SrcC;
    LIGHTEN DstA= SrcA + DstA - SrcA*DstA DstC= SrcC*(1 - DstA) + DstC*(1 - SrcA) + max(SrcC,DstC);
    MULTIPLY DstA= SrcA * DstA DstC= SrcC * DstC;
    OVERLAY ??
    SCREEN DstA= SrcA + DstA - SrcA * DstA DstC= SrcC + DstC - SrcC * DstC;
    SRC DstA= SrcA DstC= SrcC;
    SRC_ATOP DstA= DstA DstC= SrcC * DstA + (1 - SrcA) * DstC;
    SRC_IN DstA= SrcA * DstA DstC= SrcC * DstA;
    SRC_OUT DstA= SrcA * (1 - DstA) DstC= SrcC * (1 - DstA);
    SRC_OVER DstA= SrcA + (1 - SrcA)*DstA DstC= Rc = SrcC + (1 - SrcA)*DstC;
    XOR DstA= SrcA + DstA - 2 * SrcA * DstA DstC= SrcC * (1 - DstA) + (1 - SrcA) * DstC;

    Voir aussi dans
    Aminet/wazp3D/soft3d_compositing.c

    On en conclut que SRC_OVER(_Dst) correspondrait au SRC_ALPHA,ONE_MINUS_SRC_ALPHA la formule classique de transparence d'OpenGL ou Warp3D. Ilfaut ensuite voir ce que font VRAIMENT les COMPFLAG_SrcAlphaOverride et COMPFLAG_DestAlphaOverride,et autres si on les ajoute.

    Le mode de composition est utilisé pour Wazp3D avec quelques limitations néanmoins :

    Dans Chromium, par exemple, certaines textures/couleurs sont manquantes car en Compositing2D on ne peut pas appliquer une couleur à une texture (ce que j'appelle Coloring GL) comme avec OpenGL/Warp3D (GL_MODULATE existe pas) éventuellement on peut tracer la texture puis faire une deuxième passe de couleur transparente mais alors ça merde si la tex a des parties transparentes (car colorées aussi)

    On sera jamais 100% identique à Warp3D mais des améliorations sont très possibles sur ce sujet.

    Non ce qui manque cruellement c'est le Zbuffer : si le programme l'utilise alors ça va mal fonctionner. S'il ne l'utilise pas comme FPSE,WipeOut etc... alors ça marche nickel.



    Retour à la sous-rubrique :
  • Développement

  •  Autres publications de la sous-rubrique :
     
        AmigaOS 4.1


    Laissez-vous tenter par
    AmigaOS 4.1
        AmiTheme


    AmiTheme
        Annuaire Amiga


    L'Annuaire Amiga
        Galeries Photo


    Réglages UBoot pour une carte Sii3114 sur AmigaOne
    Micro/AmigaOne


    Tous les Logos et Marques sont déposés, les commentaires sont sous la responsabilité de ceux qui les ont publiés. AmigaOS 4.x est (c) Hyperion Entertainment

    Conception graphique du thème : PowerMetal, codage : Alexandre Balaban
    Certaines images sont © Martin \"Mason\" Mertz

    Temps : 1485278022.9167 seconde(s)