CN110543370B - Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof - Google Patents

Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof Download PDF

Info

Publication number
CN110543370B
CN110543370B CN201910725094.1A CN201910725094A CN110543370B CN 110543370 B CN110543370 B CN 110543370B CN 201910725094 A CN201910725094 A CN 201910725094A CN 110543370 B CN110543370 B CN 110543370B
Authority
CN
China
Prior art keywords
engine
rewriting
bottom layer
rewrite
engine bottom
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.)
Active
Application number
CN201910725094.1A
Other languages
Chinese (zh)
Other versions
CN110543370A (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.)
Jiangsu Aijia Household Products Co Ltd
Original Assignee
Jiangsu Aijia Household Products 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 Jiangsu Aijia Household Products Co Ltd filed Critical Jiangsu Aijia Household Products Co Ltd
Priority to CN201910725094.1A priority Critical patent/CN110543370B/en
Publication of CN110543370A publication Critical patent/CN110543370A/en
Application granted granted Critical
Publication of CN110543370B publication Critical patent/CN110543370B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method for rewriting a UE4 rendering engine bottom layer and a communication mechanism thereof, belonging to the field of software, wherein the rewriting method comprises the following steps: the mechanism to rewrite the UE4 engine bottom layer to switch display depth, the mechanism to rewrite the UE4 engine bottom layer to process windows messages, the mechanism to rewrite the keyboard mouse response events of the UE4 engine bottom layer, the mechanism to rewrite the UE4 engine bottom layer to interact with other windows applications, the mechanism to rewrite the window moving zoom of the UE4 engine bottom layer, the mechanism to rewrite the UE4 engine to interact with H5 applications, and the mechanism to rewrite the timing trigger functions of the UE engine bottom layer. The rewriting method adopting the scheme can facilitate development work, does not reduce the display effect, and can obviously improve user experience. The invention also discloses a method for displaying the UE project in the QT and the UE project, and the UE4 rendering window can be embedded into the QT to be operated and displayed by rewriting a UE4 engine bottom layer mechanism, and the operation frame rate and the rendering effect are equivalent to those of the UE client.

Description

Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof
Technical Field
The invention belongs to the field of software, and particularly relates to a method for rewriting a UE4 rendering engine bottom layer and a communication mechanism thereof.
Background
The Universal Engine (UE) is a Chinese name illusion Engine, and is widely applied to the fields of game design, decoration design, virtual reality and the like.
The UE4 engine is often used by experienced engineers to design 3A games and virtual reality fields, and in many current scenarios, a non-professional person needs to use software developed by the UE4 engine, for example, a decoration company looks at a decoration effect diagram for a client, a clothing design company looks at a clothing design effect diagram for a client, and the like. The user experience of the UE client is not good for non-professionals, especially designers familiar with the operation of the H5 web page. Companies currently need to develop home decoration design software containing complex interfaces and business rules, the interfaces must use the H5 page to achieve better display effect, and the UE4 needs to interact with the H5 page and keep the use effect of the native software for users.
To meet such a demand, two methods are generally adopted in the market:
1. the UMG of the UE4 is adopted to develop service logic and release the UE4 as an exe application program, and a department interface embeds H5 pages in the exe application program by using a plug-in method.
2. Develop business logic using blueprints of the UE4 and publish the UE4 as a H5 page, which the user opens to view through a browser.
Both methods result in the defects of incapability of using new characteristics of H5 in time, difficulty in developing business logic, high recruitment cost of technical teams and the like. More importantly, the UE4 itself cannot meet the demand of internet home products for fast iteration, thereby affecting the satisfaction of the user with the design itself.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a modification method for rewriting a UE4 engine bottom layer and a method for enabling the modification method to communicate with an external application program, so that a project program developed by UE4 can be quickly integrated with an external QT application program and an H5 application, the user perception is consistent with a native desktop program, the user operation habit is consistent with the webpage operation, the rendering effect is consistent with a native UE4 program, and a developer technology stack is consistent with a mainstream H5 technology stack.
The invention adopts the following technical scheme for solving the technical problems:
a method for rewriting a UE4 rendering engine bottom layer and a communication mechanism thereof specifically comprises the following steps;
step 1, rewriting a mechanism of UE4 engine bottom layer switching display depth;
step 2, rewriting a mechanism of the UE4 engine bottom layer for processing windows messages;
step 3, rewriting the keyboard and mouse response event at the bottom layer of the UE4 engine;
step 4, rewriting the interaction mechanism of the UE4 engine bottom layer and other windows application programs, and enabling the UE4 engine bottom layer to communicate with external application programs through WebSocket by rewriting corresponding interfaces of FSocket and Frunnable;
step 5, rewriting the window moving and scaling mechanism at the bottom layer of the UE4 engine;
step 6, rewrite the mechanism of the UE4 engine to interact with other H5 applications;
and 7, rewriting a timing trigger function at the bottom layer of the UE engine, calling a Tick function in each frame of the modified UE engine, and reading a numerical value transmitted by an external application program through a shared memory, so that the external application program controls an internal rendering scene.
As a further preferable solution of the method for rewriting the UE4 rendering engine bottom layer and its communication mechanism, the step 1 is specifically as follows: the rewritten mechanism judges two situations, namely embedding the UE4 into the QT frame and embedding the native UE 4;
if a QT frame is embedded into the UE4, calling a Win32 API SetForegroundWindow to set a foreground window;
if native UE4, SetWindowPos and deferrwindowpos are called to rearrange the Z-order of windows displayed in windows.
As a further preferable solution of the method for rewriting the UE4 rendering engine bottom layer and its communication mechanism, the step 2 is specifically as follows: the rewritten UE4 engine accepts WM _ ACTIVATE and WM _ ACTIVATEAPP messages sent by the foreign window and embeds the UE4 engine into the QT frame by QT:: createWindowContainer method.
As a further preferable solution of the method for rewriting the UE4 rendering engine bottom layer and the communication mechanism thereof in the present invention, the step 3 is specifically as follows: rewriting the response logic by rewriting the OnMouseButtonUp function, the OnMouseButtonDown function, and the ProcessAccumulatedPoInterInput function,
rewriting WM _ LEFTCLICK/WM _ MIDDLECLICK/WM _ RIGHTCLICK message response function to directly read current mouse screen
The screen position and the offset value relative to the UE window are used for calculating the correct mouse coordinate.
As a further preferable solution of the method for rewriting the UE4 rendering engine bottom layer and its communication mechanism, the step 5 is as follows: the rewritten UE4 engine detects whether the position of the parent window changes when receiving the WM _ MOVALENT message, and if so, the modified OnMovedWindow function is called to reset the mouse coordinates of the UE window.
As a further preferable solution of the method for rewriting the UE4 rendering engine bottom layer and its communication mechanism of the present invention, the step 6 is specifically as follows: the rewritten UE4 engine introduces a webChannel component as a plug-in, can send and receive character strings, json data and even custom data formats to communicate with the H5 application, and can also directly call functions of the H5 application.
Advantageous effects
Compared with the prior art, the invention adopting the technical scheme has the following technical effects:
1. according to the invention, related functional modules such as traditional UE4 engine rendering, event processing and displaying are modified, so that the functions of the bottom layer of the UE4 engine are more complete, and the UE4 engine can communicate with external application programs; the result is that architecturally, other applications can perfectly integrate the UE4 engine into the same process, rendering the UE4 engine on application specific pages and windows; in effect, the actual rendering effect is consistent with that of the UE client and supports next generation rendering effect; in terms of user experience, as the H5 application is introduced to serve as a UI entrance, the user operation is quicker and more convenient;
2. by adopting the rewriting method of the scheme, the user can realize seamless switching between the UE display engine and the external program and the H5 page, the fluency is greatly improved, and the user experience can be obviously improved for the fields of home decoration design, clothing design and the like which have better rendering effect according to the customized requirements of the customer and need to interact with other application programs and web pages.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the attached drawings:
as shown in FIG. 1, the invention discloses a method for rewriting a UE4 rendering engine bottom layer and a communication mechanism thereof, wherein the rewriting method comprises the following steps: the mechanism to rewrite the UE4 engine bottom layer to switch display depth, the mechanism to rewrite the UE4 engine bottom layer to process windows messages, the mechanism to rewrite the keyboard mouse response events of the UE4 engine bottom layer, the mechanism to rewrite the UE4 engine bottom layer to interact with other windows applications, the mechanism to rewrite the window moving zoom of the UE4 engine bottom layer, the mechanism to rewrite the UE4 engine to interact with H5 applications, and the mechanism to rewrite the timing trigger functions of the UE engine bottom layer. By adopting the rewriting method of the scheme, the development work can be facilitated, the display effect cannot be reduced, and the user experience can be obviously improved.
The invention also discloses a method for displaying the UE project in the QT and the UE project, and the UE4 rendering window can be embedded into the QT to be operated and displayed by rewriting a UE4 engine bottom layer mechanism, and the operation frame rate and the rendering effect are equivalent to those of the UE client.
The invention also discloses an interaction and communication method of the UE4 project and other H5 application programs, and the operation of the H5 page can be responded in real time by the UE4 rendering window through the redesigned H5 interface, so that the user experience is equivalent to that of the native H5 page.
The specific embodiment is as follows:
a method for rewriting a UE4 rendering engine bottom layer and a communication mechanism thereof specifically comprises the following steps;
step 1, rewriting a mechanism of switching display depth of a UE4 engine bottom layer, wherein the rewritten mechanism judges two conditions of embedding a UE4 into a QT frame and native UE 4;
if a QT frame is embedded into the UE4, calling a Win32 API SetForegroundWindow to set a foreground window;
if native UE4, call SetWindowPos and DeferWindowPos to rearrange the Z-order of windows displayed in windows;
step 2, rewriting a mechanism of the UE4 engine bottom layer processing windows message, receiving WM _ ACTIVATE and WM _ ACTIVATEAPP messages sent by an external window by the rewritten UE4 engine, and embedding the UE4 engine into a QT frame by a QT (createWindowContainer) method;
step 3, rewriting a keyboard and mouse response event at the bottom layer of the UE4 engine, rewriting a WM _ LEFTCLICK/WM _ MIDDLECLICK/WM _ RIGHTCLICK message response function by rewriting a plurality of function rewriting response logics such as OnMouseButtonUp OnMouseButtonButtonw processAccumated PointInput and the like, and directly reading the current mouse screen position and the offset value relative to the UE window to calculate the correct mouse coordinate;
step 4, rewriting the interaction mechanism of the UE4 engine bottom layer and other windows application programs, and enabling the UE4 engine bottom layer to communicate with external application programs through WebSocket by rewriting corresponding interfaces of FSocket and Frunnable;
step 5, rewriting a window moving and zooming mechanism at the bottom layer of the UE4 engine, detecting whether the position of a parent window changes when the rewritten UE engine receives a WM _ MOVEEMENT message, and calling a modified OnMovedWindow function to reset the mouse coordinates of the UE window when the position of the parent window changes;
step 6, rewriting a mechanism of interaction between the UE4 engine and other H5 applications, introducing a webChannel component into the rewritten UE4 engine to serve as a plug-in, sending and receiving character strings, json data, even a custom data format, communicating with the H5 application, and directly calling a function of the H5 application;
and 7, rewriting a timing trigger function at the bottom layer of the UE engine, calling a Tick function in each frame of the modified UE4 engine, and reading a numerical value transmitted by an external application program through a shared memory, so that the external application program can control the internal rendering scene.
According to the scheme, related function modules such as traditional UE4 engine rendering, event processing and displaying are modified, so that the bottom layer of the UE4 engine has more complete functions and can communicate with external application programs. The result is: architecturally, other applications can perfectly integrate the UE4 engine into the same process, rendering the UE4 engine on application specific pages and windows; in effect, the actual rendering effect is consistent with that of the UE client and supports next generation rendering effect; from the aspect of user experience, the H5 application is introduced as a UI entrance, so that the user operation is quicker and more convenient.
By adopting the rewriting method of the scheme, a user can realize seamless switching between the UE display engine and an external program and an H5 page, the fluency is greatly improved, and the user experience can be obviously improved for some fields such as home decoration design, clothing design and the like which have better rendering effect according to the customization requirements of customers and need to interact with other application programs and web pages.

Claims (1)

1. A method of rewriting UE4 rendering engine infrastructure and its communication mechanisms, characterized by: the method specifically comprises the following steps;
step 1, rewriting a mechanism of UE4 engine bottom layer switching display depth;
step 2, rewriting a mechanism of the UE4 engine bottom layer for processing windows messages;
step 3, rewriting the keyboard and mouse response event at the bottom layer of the UE4 engine;
step 4, rewriting the interaction mechanism of the UE4 engine bottom layer and other windows application programs, and enabling the UE4 engine bottom layer to communicate with external application programs through WebSocket by rewriting corresponding interfaces of FSocket and Frunnable;
step 5, rewriting the window moving and scaling mechanism at the bottom layer of the UE4 engine;
step 6, rewrite the mechanism of the UE4 engine interaction with other H5 applications;
step 7, rewriting a timing trigger function at the bottom layer of the UE engine, calling a Tick function in each frame of the modified UE engine, and reading a numerical value transmitted by an external application program through a shared memory, so that the external application program controls an internal rendering scene;
the step 1 is specifically as follows: the rewritten mechanism judges two situations, namely embedding the UE4 into the QT frame and embedding the native UE 4;
if a QT frame is embedded into the UE4, calling a Win32 API SetForegroundWindow to set a foreground window;
if native UE4, call SetWindowPos and DeferWindowPos to rearrange the Z-order of windows displayed in windows;
the step 2 is specifically as follows: the rewritten UE4 engine receives WM _ ACTIVATE and WM _ ACTIVATEAPP messages sent by an external window, and the UE4 engine is embedded into a QT frame through a QT:: createWindowContainer method;
the step 3 is specifically as follows: rewriting the response logic by rewriting the OnMouseButtonUp function, the OnMouseButtonDown function, and the ProcessAccumulatedPoInterInput function,
rewriting WM _ LEFTCLICK/WM _ MIDDLECLICK/WM _ RIGHTCLICK message response function to directly read current mouse screen
Calculating the correct mouse coordinate by the screen position and the offset value relative to the UE window;
the step 5 is specifically as follows: the rewritten UE4 engine detects whether the position of the parent window changes when receiving the WM _ MOVAEMENT message, and if so, the modified OnMovedWindow function is called to reset the mouse coordinates of the UE window;
the step 6 is specifically as follows: the rewritten UE4 engine introduces webChannel components as plug-ins for sending and receiving strings, json data, or custom format data to communicate with the H5 application, or for directly calling functions of the H5 application.
CN201910725094.1A 2019-08-07 2019-08-07 Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof Active CN110543370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910725094.1A CN110543370B (en) 2019-08-07 2019-08-07 Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910725094.1A CN110543370B (en) 2019-08-07 2019-08-07 Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof

Publications (2)

Publication Number Publication Date
CN110543370A CN110543370A (en) 2019-12-06
CN110543370B true CN110543370B (en) 2022-07-08

Family

ID=68710085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910725094.1A Active CN110543370B (en) 2019-08-07 2019-08-07 Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof

Country Status (1)

Country Link
CN (1) CN110543370B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111627096A (en) * 2020-05-07 2020-09-04 江苏原力数字科技股份有限公司 Digital human driving system based on blenshape

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095360A (en) * 2015-06-25 2015-11-25 小米科技有限责任公司 Method and device for processing user requests for browser
CN106648655A (en) * 2016-12-20 2017-05-10 惟锐(杭州)数字科技有限公司 Transformation method and device of UE engine bottom layer and method and device for displaying UE project in browser
CN109254793A (en) * 2018-09-20 2019-01-22 Oppo广东移动通信有限公司 Engine partition method, relevant device and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095360A (en) * 2015-06-25 2015-11-25 小米科技有限责任公司 Method and device for processing user requests for browser
CN106648655A (en) * 2016-12-20 2017-05-10 惟锐(杭州)数字科技有限公司 Transformation method and device of UE engine bottom layer and method and device for displaying UE project in browser
CN109254793A (en) * 2018-09-20 2019-01-22 Oppo广东移动通信有限公司 Engine partition method, relevant device and computer readable storage medium

Also Published As

Publication number Publication date
CN110543370A (en) 2019-12-06

Similar Documents

Publication Publication Date Title
US11347389B2 (en) File processing method, terminal, and storage medium
CN103530018B (en) The method for building up and mobile terminal at widget interface in Android operation system
TWI588732B (en) Computing device and computer-implemented method for presenting an application change through a tile
CN107992301A (en) User interface implementation method, client and storage medium
MX2013003515A (en) Instant remote rendering.
CN107608550B (en) Touch operation response method and device
KR20040060806A (en) Template-based customization of a user interface for a messaging application program
WO2018120992A1 (en) Window rendering method and terminal
CN112445564B (en) Interface display method, electronic device and computer readable storage medium
CN109445891B (en) Picture configuration and display method, device and computer readable storage medium
CN110543370B (en) Method for rewriting UE4 rendering engine bottom layer and communication mechanism thereof
US10289388B2 (en) Process visualization toolkit
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
CN113886110A (en) Method for embedding plug-in window of plug-in video into browser
US20190369827A1 (en) Remote data input framework
US20080320408A1 (en) Devices, Systems, and Methods Regarding Machine Vision User Interfaces
CN111324398A (en) Recent content processing method, device, terminal and storage medium
CN113867580B (en) Display control method and device for pointer in window, equipment and storage medium
CN107621910B (en) Keyboard pad and terminal
CN111506848A (en) Webpage processing method, device, equipment and readable storage medium
CN112445501A (en) Data burning method and device and computer readable storage medium
Mohomed Enabling mobile application mashups with Merlion
CN106339215A (en) Method for drawing graph in real time during recording of Windows screen
CN111949150A (en) Method and device for controlling peripheral switching, storage medium and electronic equipment
CN111859999A (en) Message translation method, device, storage medium and electronic equipment

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
CB02 Change of applicant information

Address after: 211100 floor 5, block a, China Merchants high speed rail Plaza project, No. 9, Jiangnan Road, Jiangning District, Nanjing, Jiangsu (South Station area)

Applicant after: JIANGSU AIJIA HOUSEHOLD PRODUCTS Co.,Ltd.

Address before: 211100 No. 18 Zhilan Road, Science Park, Jiangning District, Nanjing City, Jiangsu Province

Applicant before: JIANGSU AIJIA HOUSEHOLD PRODUCTS Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant