Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spine/dragonbones renderdata use rgba8 color format #12619

Merged
merged 6 commits into from
Sep 1, 2022

Conversation

zhakesi
Copy link
Contributor

@zhakesi zhakesi commented Aug 30, 2022

spine and dragonbones use simple color 4byte

@zhakesi zhakesi requested review from SantyWang and LinYunMo August 30, 2022 18:29
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -2864,8 +2864,9 @@
          * 2. 二维贴图 UV 属性(Float32)
          * 3. RGBA 颜色属性(Float32)
          */
         export const vfmtPosUvColor: gfx.Attribute[];
+        export const vfmtPosUvColor4B: gfx.Attribute[];
         /**
          * @en Vertex format with the following layout
          * 1. Vector 3 position attribute (Float32)
          * 2. Vector 2 uv attribute (Float32)
@@ -2877,8 +2878,9 @@
          * 3. 第一套 RGBA 颜色属性(Float32)
          * 3. 第二套 RGBA 颜色属性(Float32)
          */
         export const vfmtPosUvTwoColor: gfx.Attribute[];
+        export const vfmtPosUvTwoColor4B: gfx.Attribute[];
     }
     /**
      * @zh
      * UI 渲染流程

@@ -227,7 +227,7 @@ export class BaseRenderData {
*/
export class RenderData extends BaseRenderData {
public static add (vertexFormat = vfmtPosUvColor, accessor?: StaticVBAccessor) {
const rd = new RenderData(vertexFormat);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RenderData's contructor do not accept accessor parameter

} else if (attrs === vfmtPosUvTwoColor4B) {
vfm = Vertex2DFormat.V3F_T2F_C4B_C4B;
}
this._nativeObj.initialize(device, vfm, vFloatCount, iCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't pass attributes array

void UIMeshBuffer::initialize(gfx::Device* /*device*/, ccstd::vector<gfx::Attribute*>&& attrs, uint32_t /*vFloatCount*/, uint32_t /*iCount*/) {
if (attrs.size() == 4) {
_attributes.push_back(gfx::Attribute{gfx::ATTR_NAME_COLOR2, gfx::Format::RGBA32F});
void UIMeshBuffer::initialize(gfx::Device* /*device*/,Vertex2DFormat vfm, uint32_t /*vFloatCount*/, uint32_t /*iCount*/) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to figure out why can not pass array

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in c++ get a item value with null vector. i think jsb not convert class.
i have no time to find root cause, so use a simple way to avoid this problem

@zhakesi zhakesi changed the title V3.6.1 color fmt spine/dragonbones renderdata use rgba8 color format Sep 1, 2022
@SantyWang SantyWang merged commit a388541 into cocos:v3.6.1 Sep 1, 2022
cocos-robot pushed a commit to cocos-robot/engine that referenced this pull request Sep 1, 2022
dumganhar pushed a commit that referenced this pull request Sep 1, 2022
…12654)

Co-authored-by: cocos-robot <cocos-robot@cocos.com>
@zhakesi zhakesi deleted the v3.6.1-color-fmt branch February 7, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants