[go: up one dir, main page]

CN107748715A - Texture mapping configuration information detection method and its system based on Unity - Google Patents

Texture mapping configuration information detection method and its system based on Unity Download PDF

Info

Publication number
CN107748715A
CN107748715A CN201710820489.0A CN201710820489A CN107748715A CN 107748715 A CN107748715 A CN 107748715A CN 201710820489 A CN201710820489 A CN 201710820489A CN 107748715 A CN107748715 A CN 107748715A
Authority
CN
China
Prior art keywords
texture
socket
attribute
data group
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710820489.0A
Other languages
Chinese (zh)
Other versions
CN107748715B (en
Inventor
刘德建
黄彬
林志宏
钟开华
陈萍
曾捷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian TQ Digital Co Ltd
Original Assignee
Fujian TQ Digital Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian TQ Digital Co Ltd filed Critical Fujian TQ Digital Co Ltd
Priority to CN201710820489.0A priority Critical patent/CN107748715B/en
Publication of CN107748715A publication Critical patent/CN107748715A/en
Application granted granted Critical
Publication of CN107748715B publication Critical patent/CN107748715B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)
  • Stored Programmes (AREA)

Abstract

本发明提供基于Unity的纹理贴图配置信息检测方法及其系统,方法包括:Socket客户端发送检测请求至Socket服务端;Socket服务端调用测试程序执行:获取当前虚拟场景中所有物件对象;获取应用程序下名称为着色器工具的程序集;遍历程序集中所有的方法函数,建立字典;获取材质组件;获取各材质组件对应的属性数据组;获取属性数据组中各属性对应的类型;获取类型为纹理的属性;获取属性引用的纹理贴图对应的最大纹理尺寸、纹理格式以及对应的名称后返回给Socket客户端:Socket客户端与标准数据进行对比。本发明不受是否提供源代码的限制,都能实现全自动检测;且源代码能正常编译发布。

The present invention provides a texture map configuration information detection method and system based on Unity, the method includes: the Socket client sends a detection request to the Socket server; the Socket server invokes a test program to execute: obtain all object objects in the current virtual scene; obtain application programs The assembly named shader tool under the name; traverse all the method functions in the assembly, build a dictionary; obtain the material component; obtain the attribute data group corresponding to each material component; obtain the type corresponding to each attribute in the attribute data group; the obtained type is The attribute of the texture; get the maximum texture size, texture format and corresponding name corresponding to the texture map referenced by the attribute and return it to the Socket client: the Socket client compares it with the standard data. The present invention is not limited by whether source codes are provided, and can realize automatic detection; and the source codes can be normally compiled and released.

Description

基于Unity的纹理贴图配置信息检测方法及其系统Unity-based texture map configuration information detection method and system

技术领域technical field

本发明涉及虚拟现实技术领域,具体说的是一种基于Unity的纹理贴图配置信息检测方法及其系统。The invention relates to the field of virtual reality technology, in particular to a Unity-based texture map configuration information detection method and system thereof.

背景技术Background technique

随着虚拟现实技术的发展,越来越多的虚拟现实软件出现在人们的生活中。作为虚拟现实软件,沉浸感一直是用户体验的核心。目前,影响用户沉浸感的因素有很多,而虚拟世界图像的逼真度就是众多因素的其中之一。造成虚拟现实软件场景图像清晰度模糊的最直接原因就是软件场景贴图的分辨率不足,难以提供用户逼真的画质体验。With the development of virtual reality technology, more and more virtual reality software appears in people's life. As virtual reality software, immersion has always been at the core of user experience. At present, there are many factors that affect the user's immersion, and the fidelity of the virtual world image is one of them. The most direct reason for the fuzzy definition of virtual reality software scene images is that the resolution of software scene maps is insufficient, making it difficult to provide users with a realistic picture quality experience.

而造成软件贴图分辨率不足的因素很多,在假设设计人员提供了分辨率质量较高的贴图的情况下,在开发引擎中,对于贴图属性的不合理配置也将导致贴图失真,从而降低虚拟现实软件带给用户的逼真度体验。There are many factors that cause the insufficient resolution of software textures. Assuming that the designer provides textures with high resolution and quality, unreasonable configuration of texture properties in the development engine will also lead to texture distortion, thereby reducing the quality of virtual reality. Realistic experience that software brings to users.

目前虚拟现实软件测试领域缺少对于软件纹理贴图分辨率相关属性配置的检测方案。常规的基于Unity3D开发引擎的纹理贴图的测试方法,一般是通过手工测试的方式进行,测试人员需要获取项目工程的源代码,其中包含了所有的纹理贴图,这些贴图文件中包含了被引用的贴图和未被引用的贴图,如果通过常规的黑盒测试的方式对每一张被引用的贴图的配置进行手工检测,当一个项目的工程目录包含了大量的贴图资源时,则需要消耗大量的时间和人力进行检测,耗时耗力。同时,在完成检测工作后,需要检测人员手工收集检测数据,做数据的比对分析,并且将测试数据填写到测试报告中,这样无疑再次增加了检测人员的工作量以及时间成本的投入。At present, in the field of virtual reality software testing, there is a lack of detection schemes for the configuration of software texture map resolution-related attributes. The conventional testing method of texture maps based on the Unity3D development engine is generally carried out through manual testing. The tester needs to obtain the source code of the project project, which contains all the texture maps, and these map files contain the referenced texture maps. And unreferenced textures, if the configuration of each referenced texture is manually detected through conventional black-box testing, when a project's project directory contains a large number of texture resources, it will take a lot of time It is time-consuming and labor-intensive to detect with manpower. At the same time, after the inspection work is completed, the inspectors need to manually collect the inspection data, do data comparison and analysis, and fill in the test data in the test report, which undoubtedly increases the workload and time cost of the inspectors again.

目前主要影响纹理贴图分辨率相关的配置属性分别为Max Size(最大分辨率,该属性用于限制Unity3D引擎导入的贴图的分辨率大小),Format(格式,改属性能够设置纹理的格式)。Max Size属性用于限制导入纹理贴图的最大尺寸。当纹理贴图资源的原始分辨率小于Max Size设置的最大尺寸时,开发引擎将默认使用贴图的原始尺寸;当纹理贴图资源的原始分辨率大于Max Size设置的最大尺寸时,开发引擎会对图片分辨率进行压缩处理,这将导致纹理贴图出现失真,模糊的现象。由于虚拟现实软件对于贴图资源的分辨率具有较高的要求,贴图的分辨率一般不低于2048*2048,因此,在测试过程中,需要检查Max Size的配置不应小于2048。Format属性用于设置该纹理贴图使用的内部表现格式。它包含了三种类型,分别是:Compressed、16bit,以及Truecolor。其中,Compressed表示压缩的RGB纹理,这是漫反射贴图最长的格式,每个像素占4bits;假设一张贴图的分辨率为256*256,则该纹理将占用32Kb的内存。16bit表示低质量的真彩显示,每个像素占16bits。Truecolor表示真彩画质,这是最高的图像质量,假设一张贴图的分辨率为256*256,则该纹理将占用256Kb的内存。由于目前主流的虚拟现实外接式头盔显示设备对于硬件的要求都比较高,所以虚拟现实软件可以适当的忽略由于高质量的图像会占用更多的内存对性能产生的影响。一般采用Truecolor这个配置来提高贴图的质量。At present, the configuration properties that mainly affect the texture map resolution are Max Size (maximum resolution, this property is used to limit the resolution of the texture imported by the Unity3D engine), Format (format, changing the property can set the format of the texture). The Max Size property is used to limit the maximum size of the imported texture map. When the original resolution of the texture map resource is smaller than the maximum size set by Max Size, the development engine will use the original size of the texture by default; when the original resolution of the texture map resource is greater than the maximum size set by Max Size, the development engine will distinguish the image The compression rate will cause the texture map to be distorted and blurred. Since virtual reality software has high requirements for the resolution of texture resources, the resolution of textures is generally not lower than 2048*2048. Therefore, during the test, it is necessary to check that the Max Size configuration should not be smaller than 2048. The Format property is used to set the internal representation format used by the texture map. It contains three types, namely: Compressed, 16bit, and Truecolor. Among them, Compressed means compressed RGB texture, which is the longest format of diffuse reflection map, and each pixel occupies 4 bits; assuming that the resolution of a map is 256*256, the texture will occupy 32Kb of memory. 16bit means low-quality true color display, each pixel occupies 16bits. Truecolor means true color quality, which is the highest image quality. Assuming a texture with a resolution of 256*256, the texture will take up 256Kb of memory. Since the current mainstream virtual reality external head-mounted display devices have relatively high hardware requirements, the virtual reality software can properly ignore the impact on performance due to high-quality images occupying more memory. Generally, the Truecolor configuration is used to improve the quality of the texture.

测试人员通过手工匹配这些参数的方式对虚拟现实软件的贴图资源的属性配置进行检查,从而排除引擎配置原因对于纹理贴图质量的影响。The testers checked the attribute configuration of the texture resource of the virtual reality software by manually matching these parameters, so as to rule out the influence of the engine configuration on the quality of the texture map.

但是,上述纹理贴图相关配置参数的检测方式存在以下问题:However, the detection method of the above texture map related configuration parameters has the following problems:

问题1:只能通过手工测试的方式来完成,当需要检测的纹理贴图资源较多时,需要消耗大量的时间成本和人力成本;Problem 1: It can only be done by manual testing. When there are many texture map resources to be detected, it will consume a lot of time and labor costs;

问题2:基于上述的方法需要项目的工程源代码,一般情况下,开发人员不会向测试人员提供项目源代码,这样容易造成测试盲区。其次,在拥有工程源代码的情况下,通过调用Unity接口的方式获取贴图分辨率相关配置需要引用Unity引擎的编辑类,这会导致工程源代码无法正常编译发布。Question 2: Based on the above method, the engineering source code of the project is required. Generally, the developer will not provide the project source code to the tester, which will easily cause a blind spot in the test. Secondly, if you have the project source code, you need to refer to the editing class of the Unity engine to obtain the relevant configuration of the texture resolution by calling the Unity interface, which will cause the project source code to fail to be compiled and released normally.

问题3:上述方法在测试完成时,需要手工对测试数据进行记录存储以及数据的分析,并且无法自动生成测试报告,这些在测试末期都会占用较多的时间成本。Problem 3: The above method needs to manually record and store the test data and analyze the data when the test is completed, and the test report cannot be automatically generated, which will take up a lot of time and cost at the end of the test.

发明内容Contents of the invention

本发明所要解决的技术问题是:提供一种基于Unity的纹理贴图配置信息检测方法及其系统,不受是否提供源代码的限制,能实现全自动检测,且不会对源代码的正常编译发布造成影响。The technical problem to be solved by the present invention is: to provide a texture map configuration information detection method and system based on Unity, which is not limited by whether to provide source code, can realize automatic detection, and will not affect the normal compilation and release of source code make an impact.

为了解决上述技术问题,本发明采用的技术方案为:In order to solve the problems of the technologies described above, the technical solution adopted in the present invention is:

基于Unity的纹理贴图配置信息检测方法,包括:A detection method for texture map configuration information based on Unity, including:

Socket客户端发送纹理贴图配置信息检测请求至Socket服务端;The Socket client sends a texture map configuration information detection request to the Socket server;

Socket服务端依据请求调用测试程序执行以下S1至S9的步骤:The Socket server calls the test program according to the request to perform the following steps from S1 to S9:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端;S9: Acquiring all texture maps including names, data groups corresponding to the maximum texture size and texture format, and returning the data groups to the Socket client;

Socket客户端解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息。The Socket client parses the data group, compares the maximum texture size and texture format corresponding to each texture map with the standard data, and obtains comparison information.

本发明提供的另一个技术方案为:Another technical scheme provided by the present invention is:

基于Unity的纹理贴图配置信息检测系统,包括:Unity-based texture map configuration information detection system, including:

Socket客户端,用于发送纹理贴图配置信息检测请求至Socket服务端;还用于解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息;The Socket client is used to send a texture map configuration information detection request to the Socket server; it is also used to analyze the data group, and compare the maximum texture size and texture format corresponding to each texture map with standard data to obtain comparison information;

Socket服务端,用于依据请求调用测试程序;Socket server, used to call the test program according to the request;

第一计算机可读存储介质,其上存储有测试程序,该测试程序被Socket服务端调用时实现以下步骤:The first computer-readable storage medium stores a test program on it, and realizes the following steps when the test program is called by the Socket server:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端。S9: Get all texture maps including names, corresponding maximum texture size and texture format data sets, and return the data sets to the Socket client.

本发明的有益效果在于:本发明基于C/S结构,通过Socket通信方式,实现测试框架与虚拟现实软件间的远程数据交互,进而实现在即使没有提供源代码的情况下,也能实现自动化检测;同时,测试程序采用C#的反射机制获取对应接口的数据,而非通过引用Unity3D的Editor类实现,因此还解决了源代码无法编译发布的问题。The beneficial effects of the present invention are: the present invention is based on the C/S structure, realizes the remote data interaction between the test framework and the virtual reality software through the Socket communication mode, and then realizes automatic detection even without providing the source code ; At the same time, the test program uses the reflection mechanism of C# to obtain the data of the corresponding interface instead of referencing the Editor class of Unity3D, so it also solves the problem that the source code cannot be compiled and released.

附图说明Description of drawings

图1为本发明一种基于Unity的纹理贴图配置信息检测方法的流程示意图;Fig. 1 is a schematic flow chart of a Unity-based texture map configuration information detection method of the present invention;

图2为本发明实施例一中测试框架与虚拟现实软件基于Socket通信的原理图;Fig. 2 is the schematic diagram based on Socket communication between test framework and virtual reality software in Embodiment 1 of the present invention;

图3为本发明实施例一的检测方法的流程示意图。FIG. 3 is a schematic flow chart of the detection method of Embodiment 1 of the present invention.

具体实施方式Detailed ways

为详细说明本发明的技术内容、所实现目的及效果,以下结合实施方式并配合附图予以说明。In order to describe the technical content, achieved goals and effects of the present invention in detail, the following descriptions will be made in conjunction with the embodiments and accompanying drawings.

本发明最关键的构思在于:通过Socket通信方式,实现测试框架与虚拟现实软件间的远程数据交互,且测试程序采用C#的反射机制进行处理,实现了不管有没有源代码情况都能进行纹理贴图配置信息的全自动化测试,且不影响源代码的正常编译发布。The most critical idea of the present invention is: through the Socket communication mode, the remote data interaction between the test framework and the virtual reality software is realized, and the test program is processed by the reflection mechanism of C#, so that texture mapping can be performed regardless of whether there is source code or not Fully automated testing of configuration information without affecting the normal compilation and release of source code.

本发明涉及的技术术语解释:Explanation of technical terms involved in the present invention:

请参照图1和图2,本发明提供一种基于Unity的纹理贴图配置信息检测方法,包括:Please refer to Fig. 1 and Fig. 2, the present invention provides a kind of texture map configuration information detection method based on Unity, comprising:

Socket客户端发送纹理贴图配置信息检测请求至Socket服务端;The Socket client sends a texture map configuration information detection request to the Socket server;

Socket服务端依据请求调用测试程序执行以下S1至S9的步骤:The Socket server calls the test program according to the request to perform the following steps from S1 to S9:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端;S9: Acquiring all texture maps including names, data groups corresponding to the maximum texture size and texture format, and returning the data groups to the Socket client;

Socket客户端解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息。The Socket client parses the data group, compares the maximum texture size and texture format corresponding to each texture map with the standard data, and obtains comparison information.

从上述描述可知,本发明的有益效果在于:能够最大程度的解放对于该专项检测的人力投入,通过自动化实现纹理贴图的配置信息的获取,必要数据的计算等,能够大幅度降低人力的投入,且同时适用于没有提供源代码的虚拟现实应用程序;进一步的,测试程序采用C#的反射机制进行处理,而非引用Editor类,能够实现纹理贴图分辨率配置信息获取相关接口的使用,解决了编译发布的问题。It can be seen from the above description that the beneficial effects of the present invention are: it can liberate the human input for the special detection to the greatest extent, realize the acquisition of the configuration information of the texture map, the calculation of the necessary data, etc. through automation, and can greatly reduce the human input. And at the same time, it is applicable to virtual reality applications without source code; further, the test program uses the reflection mechanism of C# for processing instead of referencing the Editor class, which can realize the use of relevant interfaces for texture map resolution configuration information acquisition, and solves the problem of compiling Posted question.

进一步的,还包括:Socket客户端调用报告接口,依据所述对比信息生成测试报表。Further, it also includes: the Socket client calls the report interface, and generates a test report according to the comparison information.

由上述描述可知,通过报告接口的方式,实现了自动化生成测试报告,再次节约了人力投入和时间成本的投入;同时能更直观的展示测试结果。From the above description, it can be seen that through the report interface, the automatic generation of test reports is realized, which again saves manpower and time costs; at the same time, the test results can be displayed more intuitively.

进一步的,在所述Socket客户端发送纹理贴图配置信息检测请求至Socket服务端之前,还包括:Further, before the Socket client sends the texture map configuration information detection request to the Socket server, it also includes:

在客户端搭建测试框架,并在测试框架中创建Socket客户端;Build a test framework on the client side and create a Socket client in the test framework;

在应用程序运行时,创建Socket服务端挂载在所述应用程序上;When the application program is running, create a Socket server and mount it on the application program;

当Socket服务端监听到Socket客户端通过服务端的IP地址和端口号发送过来的连接请求后,建立与Socket客户端之间的通信连接关系。When the Socket server monitors the connection request sent by the Socket client through the IP address and port number of the server, it establishes a communication connection relationship with the Socket client.

由上述描述可知,采用C/S结构设计模式,通过Socket通信的方式,实现了测试框架与虚拟现实软件间的远程数据交互。It can be seen from the above description that the remote data interaction between the test framework and the virtual reality software is realized by using the C/S structure design mode and through the Socket communication.

进一步的,所述Socket服务端和测试程序通过挂载的方式集成在应用程序中。Further, the Socket server and the test program are integrated in the application program by means of mounting.

由上述描述可知,能够在基于虚拟现实技术的应用程序运行时,便自动进行纹理贴图配置信息的检测。It can be seen from the above description that when the application program based on the virtual reality technology is running, the texture map configuration information can be automatically detected.

进一步的,所述S9中,所述数据组为json数据格式;所述Socket客户端解析所述数据组,具体为:Further, in the S9, the data group is in json data format; the Socket client parses the data group, specifically:

所述Socket客户端对json数据格式的数据组进行反序列化处理,得到各纹理贴图对应的最大纹理尺寸和纹理格式。The Socket client deserializes the data group in the json data format to obtain the maximum texture size and texture format corresponding to each texture map.

由上述描述可知,采用json数据格式进行传输,方便传输,且冗余字符较少;同时,也方便转换、易于阅读。It can be seen from the above description that the json data format is used for transmission, which is convenient for transmission and has fewer redundant characters; at the same time, it is also convenient for conversion and easy to read.

本发明提供的另一个技术方案为:Another technical scheme provided by the present invention is:

基于Unity的纹理贴图配置信息检测系统,包括:Unity-based texture map configuration information detection system, including:

Socket客户端,用于发送纹理贴图配置信息检测请求至Socket服务端;还用于解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息;The Socket client is used to send a texture map configuration information detection request to the Socket server; it is also used to analyze the data group, and compare the maximum texture size and texture format corresponding to each texture map with standard data to obtain comparison information;

Socket服务端,用于依据请求调用测试程序;Socket server, used to call the test program according to the request;

第一计算机可读存储介质,其上存储有测试程序,该测试程序被Socket服务端调用时实现以下步骤:The first computer-readable storage medium stores a test program on it, and realizes the following steps when the test program is called by the Socket server:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端。S9: Get all texture maps including names, corresponding maximum texture size and texture format data sets, and return the data sets to the Socket client.

进一步的,Socket客户端,还用于调用报告接口,依据所述对比信息生成测试报表。Further, the Socket client is also used to call the report interface to generate a test report according to the comparison information.

进一步的,还包括第二计算机可读存储介质,其上存储有计算机程序,该程序被客户端调用时实现以下步骤:Further, it also includes a second computer-readable storage medium, on which a computer program is stored, and when the program is invoked by the client, the following steps are implemented:

在客户端搭建测试框架,并在测试框架中创建Socket客户端;Build a test framework on the client side and create a Socket client in the test framework;

所述第一计算机可读存储介质,还存储有另一计算机程序,该程序被处理器调用时实现以下步骤:The first computer-readable storage medium also stores another computer program, which implements the following steps when invoked by the processor:

在应用程序运行时,创建Socket服务端挂载在所述应用程序上;When the application program is running, create a Socket server and mount it on the application program;

当Socket服务端监听到Socket客户端通过服务端的IP地址和端口号发送过来的连接请求后,建立与Socket客户端之间的通信连接关系。When the Socket server monitors the connection request sent by the Socket client through the IP address and port number of the server, it establishes a communication connection relationship with the Socket client.

进一步的,所述Socket服务端和测试程序通过挂载的方式集成在应用程序中。Further, the Socket server and the test program are integrated in the application program by means of mounting.

进一步的,所述S9中,所述数据组为json数据格式;Further, in said S9, said data set is in json data format;

所述Socket客户端解析所述数据组步骤,具体为:The Socket client parses the data set step, specifically:

所述Socket客户端对json数据格式的数据组进行反序列化处理,得到各纹理贴图对应的最大纹理尺寸和纹理格式。The Socket client deserializes the data group in the json data format to obtain the maximum texture size and texture format corresponding to each texture map.

实施例一Embodiment one

请参照图2和图3,本实施例提供一种基于Unity3D引擎的虚拟现实应用程序的纹理贴图配置信息检测方法,不管是否提供有源代码,都能实现测试,且针对提供源代码的情况,将不对其正常编译发布造成影响。Please refer to Fig. 2 and Fig. 3, the present embodiment provides a kind of texture mapping configuration information detection method of the virtual reality application program based on Unity3D engine, no matter whether provide source code, can realize test, and for the situation of providing source code, It will not affect its normal compilation and release.

本实施例基于搭建在客户端中的测试框架与虚拟现实软件(应用程序)的服务器端的远程通信交互实现。This embodiment is implemented based on the remote communication interaction between the test framework built in the client and the server of the virtual reality software (application program).

首先,采用C/S结构设计模式,通过Socket通信的方式,实现测试框架与虚拟现实软件间的数据交互。具体请参阅图3,在虚拟现实软件启动时,分别在虚拟框架中创建Socket客户端,在服务器端建立Socket服务端,其中,Socket服务端通过挂载的方式集成在虚拟现实软件中。First of all, the C/S structure design mode is adopted, and the data interaction between the test framework and the virtual reality software is realized through Socket communication. Please refer to Figure 3 for details. When the virtual reality software is started, a Socket client is created in the virtual framework, and a Socket server is established on the server. The Socket server is integrated into the virtual reality software by mounting.

Socket服务端实时监听来自Socket客户端的连接请求,开启阻塞模式直到Socket客户端发来连接请求。The Socket server monitors the connection request from the Socket client in real time, and turns on the blocking mode until the Socket client sends a connection request.

具体的,通过挂载的脚本组件分别调用socket()创建TCP套接口,bind()绑定IP地址和端口号,listen()转换主动套接口为被动套接口完成初始化服务器,并阻塞等待客户端的连接请求。Specifically, through the mounted script components, call socket() to create a TCP socket, bind() to bind the IP address and port number, listen() to convert the active socket to a passive socket to complete the initialization of the server, and block the waiting for the client Connection request.

然后,测试框架在完成Socket客户端初始化后,并接收到测试指令时,Socket客户端通过服务器端的IP地址和端口号向服务器端发送连接请求;优选Socket客户端通过调用connect()向服务器发送连接请求,并在发送请求后阻塞等待服务器应答;Then, after the test framework completes the initialization of the Socket client and receives the test instruction, the Socket client sends a connection request to the server through the IP address and port number of the server; the preferred Socket client sends a connection to the server by calling connect() request, and block waiting for the server to respond after sending the request;

Socket服务端接收到来自Socket客户端的连接请求后,对所述连接请求进行处理,建立二者的通信连接。通过Socket客户端与Socket服务端之间的通信,实现客户端与服务器端之间远程的数据交互。优选的,服务器回复应答并阻塞等待客户端发送请求数据后,客户端同样回复一个连接成功的应答,此时客户端和服务器建立通信连接。After receiving the connection request from the Socket client, the Socket server processes the connection request and establishes a communication connection between the two. Through the communication between the Socket client and the Socket server, the remote data interaction between the client and the server is realized. Preferably, after the server replies with a reply and blocks and waits for the client to send the request data, the client also replies with a connection success reply, and at this time the client and the server establish a communication connection.

Socket客户端发送包含了测试程序的调用指令的纹理贴图配置信息检测请求至Socket服务端;The Socket client sends the texture map configuration information detection request including the call instruction of the test program to the Socket server;

Socket服务端接收上述请求,并处理,获取其中的调用指令,并据此调用对应的测试程序进行应用程序中纹理贴图配置信息检测,其中,测试程序也是以挂载的方式集成在虚拟现实软件中,在测试程序执行期间测试框架的Socket客户端阻塞等待服务器应答。The Socket server receives the above request, processes it, obtains the call instruction, and calls the corresponding test program to detect the texture map configuration information in the application program. The test program is also integrated in the virtual reality software by mounting , during the execution of the test program, the Socket client of the test framework blocks and waits for the server to reply.

Socket服务端在执行完成后会将采集的数据以Json数据组的格式返回给Socket客户端;测试框架会对返回数据进行解析,与标准数据进行比对,得到比较信息。具体的,所述解析处理包括通过JsonConvert类的DeserializeObject函数对包含了数据组的json字符串进行反序列化处理。测试框架连接数据库,提取数据库中的标准数据表,该表记录了用于衡量测试结果的标准信息(Max Size为2048*2048,Format为Compressed)。数据组中的材质的纹理贴图的最大分辨率设置,以及材质的纹理贴图的图片格式设置一一与标准数据进行匹配,然后根据预先定义的格式提取比对信息。优选将统计出测试报表所需的信息,包含了测量编号,材质的纹理贴图的最大分辨率符合标准的纹理贴图的通过数和未通过数,材质的纹理贴图的图片格式设置准确性的通过数和未通过数。最后,测试框架调用报告接口,通过传递这些信息,生成对应的测试报表。最后,客户端调用close()向Socket服务端发送中断连接请求,Socket服务端接收到请求后,中断连接。After the execution is completed, the Socket server will return the collected data to the Socket client in the format of a Json data group; the test framework will analyze the returned data, compare it with the standard data, and obtain comparison information. Specifically, the parsing process includes deserializing the json string containing the data group through the DeserializeObject function of the JsonConvert class. The test framework connects to the database and extracts the standard data table in the database, which records the standard information used to measure the test results (Max Size is 2048*2048, Format is Compressed). The maximum resolution setting of the texture map of the material in the data group, and the image format setting of the texture map of the material are matched with the standard data one by one, and then the comparison information is extracted according to the predefined format. Preferably, the information needed for the test report will be counted, including the measurement number, the number of passing and failing texture maps whose maximum resolution of the texture map of the material meets the standard, and the number of passing numbers of the image format setting accuracy of the texture map of the material and failed counts. Finally, the test framework calls the report interface, and generates the corresponding test report by passing the information. Finally, the client calls close() to send a disconnection request to the Socket server, and the Socket server terminates the connection after receiving the request.

下面,将以所述虚拟现实软件为游戏软件为例,详细说明测试程序被调用后执行的具体步骤,在此,虚拟现实软件将不限于游戏软件,还可以是其他的包含有纹理贴图的虚拟现实软件,对应的参数只需适应性改变即可。Next, taking the virtual reality software as game software as an example, the specific steps executed after the test program is invoked will be described in detail. Here, the virtual reality software will not be limited to game software, but can also be other virtual For real software, the corresponding parameters only need to be changed adaptively.

测试程序被调用后执行包括以下步骤:After the test program is called, the execution includes the following steps:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

具体的,在测试程序初始化时,将通过FindObjectsWithType函数获取当前虚拟场景中类型为GameObject类型(Gameobject是一个类型,所有的游戏物件都是这个类型的对象。)的对象;同时声明一个GameObject类型的数组用于存放获取的对象集合,声明一个Key(关键字)类型为String(字符串类型),Value类型为MethodInfo的字典,该字典将用于存储测试程序从程序集中提取的方法函数。Specifically, when the test program is initialized, objects of the type GameObject (Gameobject is a type, and all game objects are objects of this type.) in the current virtual scene will be obtained through the FindObjectsWithType function; at the same time, an array of GameObject type will be declared It is used to store the obtained object collection, and declares a dictionary whose Key (keyword) type is String (string type) and Value type is MethodInfo. This dictionary will be used to store the method functions extracted from the assembly by the test program.

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

具体的,测试程序通过AppDomain类,根据lambda表达式Textrue=>Texture.GetType().Any(t=>t.Name==”ShaderUtil”)筛选出名称为ShaderUtil的程序集,该程序集为Unity3D引擎的着色器工具类。Specifically, the test program uses the AppDomain class to filter out the assembly named ShaderUtil according to the lambda expression Texttrue=>Texture.GetType().Any(t=>t.Name==”ShaderUtil”), which is Unity3D The engine's shader utility class.

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

具体的,通过反射机制遍历该程序集中的所有方法函数,以该程序集中的方法函数的函数名作为Key(关键字),以函数的方法体信息作为Value(值),依次存储到申明的字典中。Specifically, traverse all the method functions in the assembly through the reflection mechanism, use the function name of the method function in the assembly as the Key (keyword), use the method body information of the function as the Value (value), and store them in the declaration in the dictionary.

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

具体的,在应用程序的帧更新时,申明一个纹理类型的列表,该列表用于存储获取的材质的纹理贴图;遍历在测试程序初始化时获取的当前场景的所有游戏对象,每一个Unity引擎的游戏对象都包含了一个组件列表,通过挂载的形式可以向该列表添加新的组件;判断游戏对象的组件列表是否包含Material(材质)组件,如果包含该组件,则通过GetComponent方法获取游戏对象的组件列表中的Material(材质)组件,如果不包含该组件,则继续遍历剩余的游戏对象。Specifically, when the frame of the application is updated, declare a list of texture types, which is used to store the texture map of the obtained material; traverse all the game objects of the current scene obtained when the test program is initialized, and each Unity engine All game objects contain a component list, and new components can be added to the list by mounting; determine whether the component list of the game object contains a Material (material) component, and if it contains the component, obtain the game object through the GetComponent method The Material (material) component in the component list, if this component is not included, continue to traverse the remaining game objects.

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

具体的,从存储了ShaderUtil程序集的所有方法函数的字典中通过关键字GetPropertyCount获取对应的方法体,通过该方法函数能够获取到Material(材质)组件的属性数据组,其返回的数据包含了该材质所拥有的所有属性构成的数据组。Specifically, the corresponding method body is obtained through the keyword GetPropertyCount from the dictionary that stores all the method functions of the ShaderUtil assembly, through which the property data group of the Material (material) component can be obtained, and the returned data includes the A data group consisting of all properties owned by the material.

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

具体的,在获取到属性类型后,判断属性类型是否为Texture(纹理):通过同样的方式,从字典中提取关键字为GetPropertyType所对应的方法体,该方法用于读取属性的类型信息,并申明一个纹理类型的列表(用于存储获取到纹理贴图);遍历材质的属性数据组,判断属性的类型是否属于Texture(纹理),如果属于Texture类型,则将该Texture类型属性所引用的纹理贴图保存到定义的纹理类型列表中;如果判断属性的类型不属于Texture,则跳过该属性继续编写下一个属性,直到完成所有属性的遍历。Specifically, after obtaining the attribute type, judge whether the attribute type is Texture (texture): in the same way, extract the method body corresponding to the keyword GetPropertyType from the dictionary, and this method is used to read the type information of the attribute. And declare a list of texture types (used to store the obtained texture map); traverse the attribute data group of the material to determine whether the type of the attribute belongs to Texture (texture), if it belongs to Texture type, then use the texture referenced by the Texture type attribute The texture is saved in the defined texture type list; if it is judged that the type of the attribute does not belong to Texture, skip this attribute and continue writing the next attribute until the traversal of all attributes is completed.

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

具体的,在S7完成所有对象的遍历后,返回存储的纹理类型列表;测试程序通过AppDomain类,根据lambda表达式Textrue=>Texture.GetType().Any(t=>t.Name==”TextureImporter”)筛选出名称为TextureImporter的程序集,该程序集为Unity3D引擎的纹理导入器类;通过反射机制分别获取maxTextureSize和textureFormat这两个方法函数;maxTextureSize函数用于读取纹理贴图支持的最大分辨率,即Max Size(最大纹理尺寸),通过该函数读取的数据为只读类型;textureFormat函数用于读取纹理贴图的图片格式。通过这两个方法函数,得到材质的纹理贴图的最大分辨率设置以及纹理贴图的格式。Specifically, after S7 completes the traversal of all objects, it returns the stored texture type list; the test program passes through the AppDomain class, according to the lambda expression Texture=>Texture.GetType().Any(t=>t.Name=="TextureImporter ") Filter out the assembly named TextureImporter, which is the texture importer class of the Unity3D engine; obtain the two method functions of maxTextureSize and textureFormat through the reflection mechanism; the maxTextureSize function is used to read the maximum resolution supported by the texture map , that is, Max Size (maximum texture size), the data read through this function is read-only; the textureFormat function is used to read the image format of the texture map. Through these two method functions, the maximum resolution setting of the texture map of the material and the format of the texture map are obtained.

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端;S9: Acquiring all texture maps including names, data groups corresponding to the maximum texture size and texture format, and returning the data groups to the Socket client;

具体的,通过引擎暴露的name()接口直接读取纹理贴图的名称信息;然后将这些数据以Json的格式返回给Socket服务端,并发送到测试框架的客户端Socket进行解析处理。Specifically, directly read the name information of the texture map through the name() interface exposed by the engine; then return the data to the Socket server in Json format, and send it to the client Socket of the test framework for parsing and processing.

上述测试程序的执行,能解决现有技术通过直接调用Unity3D接口获取材质的纹理贴图分辨率相关配置的具体数值需引用Unity3D的Editor类,从而将导致Unity3D工程源代码在编译发布的时候因为提示错误导致发布失败的问题。本实施例的测试程序采用了C#的反射机制进行处理,获取已加载到此应用程序域的执行上下文中的程序集,根据lambda表达式:Textrue=>Texture.GetType().Any(t=>t.Name==”ShaderUtil”)筛选出名称为ShaderUtil的程序集合,并返回集合中的第一个元素,如果没有则返回默认值。通过GetMethods()方法获取ShaderUtil类中的所有方法,其返回类型为MethodInfo类型,用于取得该类的方法的信息。通过这种方式,测试程序在未引用Editor类的情况下,依然能够实现纹理贴图分辨率配置信息获取相关接口的使用,解决了编译发布的问题。Execution of the above-mentioned test program can solve the problem of obtaining the texture map resolution of the material in the prior art by directly calling the Unity3D interface. The specific value of the related configuration needs to refer to the Editor class of Unity3D, which will cause an error when the source code of the Unity3D project is compiled and released. Issues that cause publishing to fail. The test program of this embodiment adopts the reflection mechanism of C# to process, and obtains the assembly that has been loaded into the execution context of this application domain, according to the lambda expression: Texture=>Texture.GetType().Any(t=> t.Name==”ShaderUtil”) filters out the program collection named ShaderUtil, and returns the first element in the collection, or returns the default value if there is no one. Obtain all the methods in the ShaderUtil class through the GetMethods() method, and its return type is the MethodInfo type, which is used to obtain the information of the methods of this class. In this way, without referencing the Editor class, the test program can still realize the use of related interfaces for obtaining texture map resolution configuration information, which solves the problem of compiling and publishing.

进一步的,本实施例中得Socket客户端在接收Socket服务端返回json数据格式的数据组后,将解析获取包含材质的纹理贴图的名称信息,材质的纹理贴图的最大分辨率设置,以及材质的纹理贴图的图片格式设置;然后于标准数据进行对比,并依据对比结果生成测试报告。能针对性的解决现有测试需要手动记录、分析测试数据,且无法自动生成测试报告,导致测试末期占用较多时间成本的问题。Further, after the Socket client in this embodiment receives the data group returned by the Socket server in json data format, it will analyze and obtain the name information of the texture map containing the material, the maximum resolution setting of the texture map of the material, and the texture map of the material. The image format setting of the texture map; then compare it with the standard data, and generate a test report based on the comparison result. It can specifically solve the problem that the existing test needs to manually record and analyze the test data, and the test report cannot be automatically generated, resulting in a lot of time and cost at the end of the test.

本实施例能够完整、全自动化的检测纹理贴图的分辨率相关配置信息是否符合标准,且不受是否提供项目源代码的限制,在实现智能化检测的同时,能够最大幅度降低在配置检测环节中大量时间和人力成本的投入;同时又能提高检测的效率和检测的精度。This embodiment can completely and fully automatically detect whether the resolution-related configuration information of the texture map meets the standard, and is not limited by whether the source code of the project is provided. A lot of time and labor costs are invested; at the same time, the efficiency and accuracy of detection can be improved.

实施例二Embodiment two

本实施例对应实施例一,提供一种基于Unity的纹理贴图配置信息检测系统,包括客户端、服务器端、第一计算机可读存储介质以及第二计算机可读存储介质;客户端上构建测试框架;虚拟现实软件上挂载服务器端和测试程序。This embodiment corresponds to Embodiment 1, and provides a texture map configuration information detection system based on Unity, including a client, a server, a first computer-readable storage medium, and a second computer-readable storage medium; a test framework is built on the client ; Mount the server and test program on the virtual reality software.

具体的,第二计算机可读存储介质,其上存储有计算机程序,该程序被客户端调用时实现以下步骤:Specifically, the second computer-readable storage medium has a computer program stored thereon, and when the program is invoked by the client, the following steps are implemented:

在客户端搭建测试框架,并在测试框架中创建Socket客户端;Build a test framework on the client side and create a Socket client in the test framework;

所述第一计算机可读存储介质,还存储有另一计算机程序,该程序被处理器调用时实现以下步骤:The first computer-readable storage medium also stores another computer program, which implements the following steps when invoked by the processor:

在应用程序运行时,创建Socket服务端挂载在所述应用程序上;When the application program is running, create a Socket server and mount it on the application program;

当Socket服务端监听到Socket客户端通过服务端的IP地址和端口号发送过来的连接请求后,建立与Socket客户端之间的通信连接关系。When the Socket server monitors the connection request sent by the Socket client through the IP address and port number of the server, it establishes a communication connection relationship with the Socket client.

所述Socket服务端和测试程序通过挂载的方式集成在应用程序中。The Socket server and test program are integrated in the application program by means of mounting.

Socket客户端,用于发送纹理贴图配置信息检测请求至Socket服务端;还用于解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息;还用于调用报告接口,依据所述对比信息生成测试报表;所述解析具体为所述Socket客户端对json数据格式的数据组进行反序列化处理,得到各纹理贴图对应的最大纹理尺寸和纹理格式。The Socket client is used to send a texture map configuration information detection request to the Socket server; it is also used to analyze the data group, and compare the maximum texture size and texture format corresponding to each texture map with standard data to obtain comparison information; It is used to call the report interface, and generate a test report according to the comparison information; the analysis is specifically that the Socket client deserializes the data group in the json data format, and obtains the maximum texture size and texture format corresponding to each texture map .

Socket服务端,用于依据请求调用测试程序;Socket server, used to call the test program according to the request;

第一计算机可读存储介质,其上存储有测试程序,该测试程序被Socket服务端调用时实现以下步骤:The first computer-readable storage medium stores a test program on it, and realizes the following steps when the test program is called by the Socket server:

S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene;

S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application;

S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary;

S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein;

S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body;

S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body;

S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture;

S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute;

S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端。优选所述数据组为json数据格式;S9: Get all texture maps including names, corresponding maximum texture size and texture format data sets, and return the data sets to the Socket client. Preferably, the data set is in json data format;

综上所述,本发明提供的一种基于Unity的纹理贴图配置信息检测方法及其系统,不仅能够不受是否提供源代码的限制,都能实现全自动检测,且不会对源代码的正常编译发布造成影响;并且,能够大幅度降低人力和时间的投入;进一步的,还能自动化生成测试报告,直观的展示测试结果;本发明能够实现智能化检测,提高检测的效率和检测的精度。In summary, a Unity-based texture map configuration information detection method and system provided by the present invention can not only be limited by whether to provide source code, but also can realize fully automatic detection, and will not affect the normality of the source code. Compilation and release have an impact; moreover, manpower and time input can be greatly reduced; further, test reports can be automatically generated, and test results can be displayed intuitively; the present invention can realize intelligent detection, improve detection efficiency and detection accuracy.

以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等同变换,或直接或间接运用在相关的技术领域,均同理包括在本发明的专利保护范围内。The above description is only an embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent transformations made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in related technical fields, are all included in the same principle. Within the scope of patent protection of the present invention.

Claims (10)

1.基于Unity的纹理贴图配置信息检测方法,其特征在于,包括:1. A texture map configuration information detection method based on Unity, characterized in that, comprising: Socket客户端发送纹理贴图配置信息检测请求至Socket服务端;The Socket client sends a texture map configuration information detection request to the Socket server; Socket服务端依据请求调用测试程序执行以下S1至S9的步骤:The Socket server calls the test program according to the request to perform the following steps from S1 to S9: S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene; S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application; S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary; S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein; S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body; S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body; S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture; S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute; S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端;S9: Acquiring all texture maps including names, data groups corresponding to the maximum texture size and texture format, and returning the data groups to the Socket client; Socket客户端解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息。The Socket client parses the data group, compares the maximum texture size and texture format corresponding to each texture map with the standard data, and obtains comparison information. 2.如权利要求1所述的基于Unity的纹理贴图配置信息检测方法,其特征在于,还包括:2. the texture mapping configuration information detection method based on Unity as claimed in claim 1, is characterized in that, also comprises: Socket客户端调用报告接口,依据所述对比信息生成测试报表。The Socket client invokes the report interface to generate a test report based on the comparison information. 3.如权利要求1所述的基于Unity的纹理贴图配置信息检测方法,其特征在于,在所述Socket客户端发送纹理贴图配置信息检测请求至Socket服务端之前,还包括:3. the texture map configuration information detection method based on Unity as claimed in claim 1, is characterized in that, before described Socket client sends texture map configuration information detection request to Socket server end, also comprises: 在客户端搭建测试框架,并在测试框架中创建Socket客户端;Build a test framework on the client side and create a Socket client in the test framework; 在应用程序运行时,创建Socket服务端挂载在所述应用程序上;When the application program is running, create a Socket server and mount it on the application program; 当Socket服务端监听到Socket客户端通过服务端的IP地址和端口号发送过来的连接请求后,建立与Socket客户端之间的通信连接关系。When the Socket server monitors the connection request sent by the Socket client through the IP address and port number of the server, it establishes a communication connection relationship with the Socket client. 4.如权利要求1所述的基于Unity的纹理贴图配置信息检测方法,其特征在于,所述Socket服务端和测试程序通过挂载的方式集成在应用程序中。4. The texture map configuration information detection method based on Unity as claimed in claim 1, wherein the Socket server and the test program are integrated in the application program by means of loading. 5.如权利要求1所述的基于Unity的纹理贴图配置信息检测方法,其特征在于,所述S9中,所述数据组为json数据格式;所述Socket客户端解析所述数据组,具体为:5. the texture map configuration information detection method based on Unity as claimed in claim 1, is characterized in that, in described S9, described data group is json data format; Described Socket client side parses described data group, specifically : 所述Socket客户端对json数据格式的数据组进行反序列化处理,得到各纹理贴图对应的最大纹理尺寸和纹理格式。The Socket client deserializes the data group in the json data format to obtain the maximum texture size and texture format corresponding to each texture map. 6.基于Unity的纹理贴图配置信息检测系统,其特征在于,包括:6. A texture mapping configuration information detection system based on Unity, characterized in that, comprising: Socket客户端,用于发送纹理贴图配置信息检测请求至Socket服务端;还用于解析所述数据组,将各纹理贴图对应的最大纹理尺寸和纹理格式与标准数据进行对比,得到对比信息;The Socket client is used to send a texture map configuration information detection request to the Socket server; it is also used to analyze the data group, and compare the maximum texture size and texture format corresponding to each texture map with standard data to obtain comparison information; Socket服务端,用于依据请求调用测试程序;Socket server, used to call the test program according to the request; 第一计算机可读存储介质,其上存储有测试程序,该测试程序被Socket服务端调用时实现以下步骤:The first computer-readable storage medium stores a test program on it, and realizes the following steps when the test program is called by the Socket server: S1:获取当前虚拟场景中所有物件对象;S1: Obtain all objects in the current virtual scene; S2:获取应用程序下名称为着色器工具的程序集;S2: Obtain the assembly named shader tool under the application; S3:遍历所述程序集中所有的方法函数,以遍历到的方法函数的函数名为key、方法函数对应的方法体为Value,建立字典;S3: traversing all the method functions in the assembly, using the function name of the traversed method function as key, and the method body corresponding to the method function as Value, to create a dictionary; S4:遍历所述所有物件对象下的组件列表,获取其中所有的材质组件;S4: traverse the component list under all the object objects, and obtain all material components therein; S5:依据所述字典,以获得所有属性构成的数据组所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取各材质组件对应的属性数据组;S5: According to the dictionary, the function name corresponding to the data group composed of all attributes is obtained, and the corresponding method body is obtained, and the attribute data group corresponding to each material component is obtained by calling the obtained method body; S6:依据所述字典,以获得属性的类型信息所对应的函数名为key,获取对应的方法体,并通过调用所获取的方法体获取所述属性数据组中各属性对应的类型;S6: According to the dictionary, obtain the function name corresponding to the type information of the attribute key, obtain the corresponding method body, and obtain the type corresponding to each attribute in the attribute data group by calling the obtained method body; S7:遍历所述属性数据组,获取类型为纹理的属性;S7: traversing the attribute data group to obtain an attribute whose type is texture; S8:获取所述属性引用的纹理贴图对应的最大纹理尺寸和纹理格式;S8: Obtain the maximum texture size and texture format corresponding to the texture map referenced by the attribute; S9:获取所有纹理贴图包括名称、对应最大纹理尺寸和纹理格式的数据组,并将所述数据组返回给Socket客户端。S9: Get all texture maps including names, corresponding maximum texture size and texture format data sets, and return the data sets to the Socket client. 7.如权利要求6所述的基于Unity的纹理贴图配置信息检测系统,其特征在于,Socket客户端,还用于调用报告接口,依据所述对比信息生成测试报表。7. The texture map configuration information detection system based on Unity as claimed in claim 6, wherein the Socket client is also used to call a report interface to generate a test report according to the comparison information. 8.如权利要求6所述的基于Unity的纹理贴图配置信息检测系统,其特征在于,还包括第二计算机可读存储介质,其上存储有计算机程序,该程序被客户端调用时实现以下步骤:8. The texture map configuration information detection system based on Unity as claimed in claim 6, further comprising a second computer-readable storage medium, on which a computer program is stored, and when the program is invoked by the client, the following steps are implemented : 在客户端搭建测试框架,并在测试框架中创建Socket客户端;Build a test framework on the client side and create a Socket client in the test framework; 所述第一计算机可读存储介质,还存储有另一计算机程序,该程序被处理器调用时实现以下步骤:The first computer-readable storage medium also stores another computer program, which implements the following steps when invoked by the processor: 在应用程序运行时,创建Socket服务端挂载在所述应用程序上;When the application program is running, create a Socket server and mount it on the application program; 当Socket服务端监听到Socket客户端通过服务端的IP地址和端口号发送过来的连接请求后,建立与Socket客户端之间的通信连接关系。When the Socket server monitors the connection request sent by the Socket client through the IP address and port number of the server, it establishes a communication connection relationship with the Socket client. 9.如权利要求6所述的基于Unity的纹理贴图配置信息检测系统,其特征在于,所述Socket服务端和测试程序通过挂载的方式集成在应用程序中。9. The texture map configuration information detection system based on Unity as claimed in claim 6, wherein the Socket server and the test program are integrated in the application program by means of loading. 10.如权利要求6所述的基于Unity的纹理贴图配置信息检测系统,其特征在于,所述S9中,所述数据组为json数据格式;10. the texture map configuration information detection system based on Unity as claimed in claim 6, is characterized in that, in described S9, described data group is json data format; 所述Socket客户端解析所述数据组步骤,具体为:The Socket client parses the data set step, specifically: 所述Socket客户端对json数据格式的数据组进行反序列化处理,得到各纹理贴图对应的最大纹理尺寸和纹理格式。The Socket client deserializes the data group in the json data format to obtain the maximum texture size and texture format corresponding to each texture map.
CN201710820489.0A 2017-09-13 2017-09-13 Unity-based texture map configuration information detection method and system Active CN107748715B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710820489.0A CN107748715B (en) 2017-09-13 2017-09-13 Unity-based texture map configuration information detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710820489.0A CN107748715B (en) 2017-09-13 2017-09-13 Unity-based texture map configuration information detection method and system

Publications (2)

Publication Number Publication Date
CN107748715A true CN107748715A (en) 2018-03-02
CN107748715B CN107748715B (en) 2020-11-17

Family

ID=61255724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710820489.0A Active CN107748715B (en) 2017-09-13 2017-09-13 Unity-based texture map configuration information detection method and system

Country Status (1)

Country Link
CN (1) CN107748715B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763052A (en) * 2018-04-11 2018-11-06 福建天晴数码有限公司 A kind of method for testing performance and system of virtual reality software memory reclaim mechanism
CN108765534A (en) * 2018-05-24 2018-11-06 武汉斗鱼网络科技有限公司 A kind of image rendering method, device, equipment and storage medium
CN110032368A (en) * 2019-04-22 2019-07-19 成都四方伟业软件股份有限公司 Information configuring methods and device
CN113347151A (en) * 2021-04-28 2021-09-03 厦门海迈科技股份有限公司 Data interaction method based on socket shared memory

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5877771A (en) * 1996-07-12 1999-03-02 Silicon Graphics, Inc. Method and apparatus for supersampling based on the local rate of change in texture
CN102622236A (en) * 2012-01-13 2012-08-01 深圳市妙趣工场信息科技有限公司 Geart three-dimensional (3D) game engine
CN104778121A (en) * 2015-03-25 2015-07-15 网易(杭州)网络有限公司 Game program test method, device and system
CN106557424A (en) * 2016-11-18 2017-04-05 腾讯科技(深圳)有限公司 Internal storage testing method, measured terminal, test client and system
CN106815131A (en) * 2016-12-27 2017-06-09 珠海金山网络游戏科技有限公司 A kind of game resource inspection method and system based on Unity engines
CN106970875A (en) * 2017-03-01 2017-07-21 福建天晴数码有限公司 The frame per second method of testing and its system of virtual reality software

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5877771A (en) * 1996-07-12 1999-03-02 Silicon Graphics, Inc. Method and apparatus for supersampling based on the local rate of change in texture
CN102622236A (en) * 2012-01-13 2012-08-01 深圳市妙趣工场信息科技有限公司 Geart three-dimensional (3D) game engine
CN104778121A (en) * 2015-03-25 2015-07-15 网易(杭州)网络有限公司 Game program test method, device and system
CN106557424A (en) * 2016-11-18 2017-04-05 腾讯科技(深圳)有限公司 Internal storage testing method, measured terminal, test client and system
CN106815131A (en) * 2016-12-27 2017-06-09 珠海金山网络游戏科技有限公司 A kind of game resource inspection method and system based on Unity engines
CN106970875A (en) * 2017-03-01 2017-07-21 福建天晴数码有限公司 The frame per second method of testing and its system of virtual reality software

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FAROUK MESSAOUDI等: "Dissecting Games Engines: the Case of Unity3D", 《IEEE》 *
薛芸等: "IDC可视化软件开发平台中的配置与编译子系统", 《计算机系统应用》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763052A (en) * 2018-04-11 2018-11-06 福建天晴数码有限公司 A kind of method for testing performance and system of virtual reality software memory reclaim mechanism
CN108765534A (en) * 2018-05-24 2018-11-06 武汉斗鱼网络科技有限公司 A kind of image rendering method, device, equipment and storage medium
CN108765534B (en) * 2018-05-24 2022-06-21 武汉斗鱼网络科技有限公司 Image rendering method, device and equipment and storage medium
CN110032368A (en) * 2019-04-22 2019-07-19 成都四方伟业软件股份有限公司 Information configuring methods and device
CN110032368B (en) * 2019-04-22 2022-09-16 成都四方伟业软件股份有限公司 Information configuration method and device
CN113347151A (en) * 2021-04-28 2021-09-03 厦门海迈科技股份有限公司 Data interaction method based on socket shared memory

Also Published As

Publication number Publication date
CN107748715B (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN107748715B (en) Unity-based texture map configuration information detection method and system
CN104484216B (en) Service interface document and on-line testing instrument generation method, device
CN107659455B (en) Method, storage medium, device and system for Mock data of iOS (internet operating system) end
CN113434396A (en) Interface test method, device, equipment, storage medium and program product
CN112559525B (en) Data checking system, method, device and server
CN113778897B (en) Automatic test method, device and equipment for interface and storage medium
CN113760734A (en) Data preparation method and device, equipment and storage medium
CN113360519A (en) Data processing method, device, equipment and storage medium
CN115033816A (en) Rule engine-based business processing method, apparatus, computer equipment and medium
CN104901845A (en) Automation test system and method of domain name WHOIS service
CN113485927B (en) Test data generation method, device, equipment and storage medium
CN109739704A (en) An interface testing method, server and computer-readable storage medium
CN108287791B (en) Detection method for texture resource allocation of virtual reality software and storage medium
CN111262753A (en) A method, system, terminal and storage medium for automatic configuration of the number of NUMA nodes
CN108153655B (en) Method for detecting drawing call quantity of virtual reality software and storage medium
CN107767434B (en) Method for acquiring texture mapping configuration information in virtual reality technology and storage medium
CN111708704A (en) A cloud real machine testing method, device, terminal and storage medium
CN108170592B (en) Remote testing method and terminal for virtual reality software performance
CN107291619B (en) Memory usage analysis method and device
CN114185791A (en) Method, device and equipment for testing data mapping file and storage medium
CN114443466A (en) Method, terminal device and storage medium for use case file to convert executable script
CN118860851A (en) Embedded database compatibility testing method and device
CN108763052A (en) A kind of method for testing performance and system of virtual reality software memory reclaim mechanism
CN111580409A (en) A fault simulation test method for real-time embedded systems
CN116955154A (en) Method and device for testing application program interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant