CN103440395A - Design system and method for realizing BlinnPhong illumination model based on lookup table - Google Patents

Design system and method for realizing BlinnPhong illumination model based on lookup table Download PDF

Info

Publication number
CN103440395A
CN103440395A CN2013104389298A CN201310438929A CN103440395A CN 103440395 A CN103440395 A CN 103440395A CN 2013104389298 A CN2013104389298 A CN 2013104389298A CN 201310438929 A CN201310438929 A CN 201310438929A CN 103440395 A CN103440395 A CN 103440395A
Authority
CN
China
Prior art keywords
blinnphong
illumination model
look
module
vector
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
CN2013104389298A
Other languages
Chinese (zh)
Other versions
CN103440395B (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.)
University of Jinan
Original Assignee
University of Jinan
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 University of Jinan filed Critical University of Jinan
Priority to CN201310438929.8A priority Critical patent/CN103440395B/en
Publication of CN103440395A publication Critical patent/CN103440395A/en
Application granted granted Critical
Publication of CN103440395B publication Critical patent/CN103440395B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a design system and a design method for realizing a BlinnPhong illumination model based on a lookup table. The design system comprises a lookup table module for realizing calculation, including reciprocal square root calculation, logarithm taking calculation and power-of-2 calculation, of a complicated mathematical expression in the BlinnPhong illumination model, and is characterized by also comprising a vector module for realizing operation, including adding and subtracting, for vectors in the BlinnPhong illumination model, a product module for realizing calculation of products in the BlinnPhong illumination model, a register module for storing and transmitting data calculated in all the previous steps in the BlinnPhong illumination model, and a main control module for scheduling all calculation steps in the BlinnPhong illumination model as well as distribution of hardware resources and realizing high-speed effective control.

Description

A kind of design system and method based on look-up tables'implementation BlinnPhong illumination model
Technical field
The present invention relates to the technical fields such as integrated circuit (IC) design technology, computer graphics techniques, specifically, relate to a kind of design system and method based on look-up tables'implementation BlinnPhong illumination model.
Background technology
Any object be among physical environment all will with arround light be related, the most basic comprise reflection, refraction, unrestrained anti-/ scattering etc.If rejected these light relations, the stereoscopic sensation of object not only can be lost, on the whole also can be very untrue to people's sensation, so, in the every field that relates to now computer graphics techniques, particularly important to the processing of illumination.
Interaction between light and body surface is the physical process of a complexity, propose now various illumination models and simulated this process, wherein the BlinnPhong illumination model is more satisfactory a kind of of effect, this modeling surround lighting, diffuse, specular light and utilizing emitted light effect, its expression formula is as follows:
I=I atm+I dif+I spc+I emi
=K aI a+K dI d(N·L)+K sI s(N·H) Ns+I e (1)
Wherein H = L + V | L + V |
For the computing of the power side of Arbitrary Digit in formula (1), can carry out in the following manner.
x y=a
log 2x y=log 2a
ylog 2x=log 2a
Order: m=ylog 2x
: a=2 m
The power side's computing that is about to Arbitrary Digit is converted to power side's computing of the computing of taking the logarithm that hardware easily realizes, multiplying and 2.
Tradition has many software and hardwares to realize the method for this illumination model, but there are the following problems:
Required time is long.
From formula (1), BlinnPhong illumination model calculation of complex, relate to the complex calculation such as vector operations, the operation of power side, and required time length is that time delay is long, and the occasion higher at requirement of real-time is restricted.
Consumes resources is many.
From formula (1), BlinnPhong illumination model calculation of complex, relate to the complex calculation such as vector operations, the operation of power side, expends hardware resource many.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of design system that realizes the BlinnPhong illumination model and method based on look-up table, realizes effectively controlling at a high speed, reduces the consumption of hardware resource, has improved the utilization factor of hardware resource.
The present invention adopts following technical scheme to realize goal of the invention:
A kind of system based on look-up tables'implementation BlinnPhong illumination model comprises:
Look-up table means: realize the calculating of complex mathematical expression formula in the BlinnPhong illumination model, comprise square root calculation reciprocal, the computing of taking the logarithm, power side's computing of 2; It is characterized in that, also comprise:
Vector module: realize in the BlinnPhong illumination model vectorial operation is comprised to vectorial plus-minus;
Product module: realize the computing of product in the BlinnPhong illumination model;
Register module: the data that in the BlinnPhong illumination model, each step calculates are preserved and transmitted;
Main control module: the distribution to each calculation procedure and hardware resource in the BlinnPhong illumination model is dispatched, and realizes effectively controlling at a high speed.
As the further restriction to the technical program, the quantity of described look-up table means is 1, and the quantity of described vector module is 2, and the quantity of described product module is 3.
As the further restriction to the technical program, described look-up table means completes single job needs 5 clock period, described vector module completes a vector operations needs 3 clock period, and described product module completes a multiplication operations needs 1 clock period.
As the further restriction to the technical program, described look-up table means comprises iSclk input end of clock mouth,
IOpcode is the compute mode input port, and iSrcA, iSrcB, iSrcC primary operand input port and oLutRes look-up table be output port as a result.
As the further restriction to the technical program, described vector module comprises iSclk input end of clock mouth, and iOpcode is vector operations mode input port, iSrcA, iSrcB, iSrcC vector input port and oVecRes output port.
As the further restriction to the technical program, described main control module comprises the Clk input end of clock, Rst_n the RESET input, Light_en enables input end, Iatm, Idif, Ispc, Iemi surround lighting composition, composition diffuses, the input end of specular light composition and utilizing emitted light composition, Ka, Kd, Ks body surface reflection of ambient light coefficient, coefficient diffuses, the input end of specular light coefficient, Ns body surface minute surface index input end, Vert_cord, Lgt_cord, View_cord body surface point coordinate, the light source coordinate, the input end of observation point coordinate, the normal vector input end of N_drct body surface point, the output terminal of the lighting effect that Wrt_en output enable end and I_o finally obtain.
A kind of method based on look-up tables'implementation BlinnPhong illumination model, is characterized in that, comprises the steps:
(1) when the main control module calls look-up table means is calculated, according to circumstances Selection and call vector module or product module;
(2), if what call is vector module, according to circumstances select whether to call the product operation simultaneously;
(3) repeating step (1) and (2), until complete all calculating of BlinnPhong illumination model.
Compared with prior art, advantage of the present invention and good effect are: the present invention realizes square root calculation reciprocal in the BlinnPhong illumination model by look-up table means, the computing of taking the logarithm, power side's computing of 2, by vector module, realize in the BlinnPhong illumination model vectorial operation, realize the computing of product in the BlinnPhong illumination model by the product module, by register module, the data that in the BlinnPhong illumination model, each step calculates are preserved and transmitted, by main control module, the distribution of each calculation procedure and hardware resource in the BlinnPhong illumination model is dispatched, realize effectively controlling at a high speed, reduce the consumption of hardware resource, improved the utilization factor of hardware resource, in addition, the present invention is punctured into and takies in many operation of clock period by taking few operation of clock period, saved the clock period, improved real-time.
The accompanying drawing explanation
Fig. 1 is the vector relations diagram in the BlinnPhong illumination model.
Fig. 2 is functional-block diagram of the present invention.
The interface schematic diagram that Fig. 3 is look-up table means.
The interface schematic diagram that Fig. 4 is vector module.
The interface schematic diagram that Fig. 5 is the product module.
The interface schematic diagram that Fig. 6 is main control module.
Wherein, 1, main control module, 2, look-up table means, 3, vector module, 4, the product module, 5, register module.
Embodiment
Below in conjunction with accompanying drawing and preferred embodiment, the present invention is further described in detail.
Referring to Fig. 1 and Fig. 2, a kind of system that realizes the BlinnPhong illumination model based on look-up table comprises:
Look-up table means: realize the calculating of complex mathematical expression formula in the BlinnPhong illumination model, comprise square root calculation reciprocal, the computing of taking the logarithm, power side's computing of 2;
Vector module: realize in the BlinnPhong illumination model vectorial operation is comprised to vectorial plus-minus;
Product module: realize the computing of product in the BlinnPhong illumination model;
Register module: the data that in the BlinnPhong illumination model, each step calculates are preserved and transmitted; Register module adopts the general memory module of prior art, does not repeat them here.
Main control module: the distribution to each calculation procedure and hardware resource in the BlinnPhong illumination model is dispatched, and realizes effectively controlling at a high speed.
The quantity of described look-up table means is 1, and the quantity of described vector module is 2, and the quantity of described product module is 3, with this, reaches the peak use rate of hardware resource.
Described look-up table means completes single job needs 5 clock period, and described vector module completes a vector operations needs 3 clock period, and described product module completes a multiplication operations needs 1 clock period.
A kind of method that realizes the BlinnPhong illumination model based on look-up table, comprise the steps:
(1) when the main control module calls look-up table means is calculated, according to circumstances Selection and call vector module or product module;
(2), if what call is vector module, according to circumstances select whether to call the product operation simultaneously;
(3) repeating step (1) and (2), until complete all calculating of BlinnPhong illumination model.
In the design's framework, when calling look-up table means, can according to circumstances carry out vector or product operation, because look-up table means needs 5 cycles, the product that meanwhile can be prepared operation, save time.In like manner, when calling vector module, also can according to circumstances carry out the product operation, further raise the efficiency.By statistics, have the operation of 5 products and vector operations and can be punctured in longer operation of clock period in the design, to computing each time, can save 8 clock period.
In Fig. 3, iSclk is the input end of clock mouth, for module provides clock signal; IOpcode is the compute mode input port, comprises the power side that adds, subtracts, takes the logarithm, asks 2, square root reciprocal; ISrcA, iSrcB, iSrcC are respectively the primary operand input port; OLutRes is look-up table output port as a result, and the result of certain operations is carried out in output to the input data.
In Fig. 4, iSclk is the input end of clock mouth, for module provides clock signal; IOpcode is vector operations mode input port, comprise add, subtract, dot product; ISrcA, iSrcB, iSrcC are respectively primary operand (vector) input port; OVecRes is output port, and the result of specific operation is carried out in output to input vector.
In Fig. 5, iSrcA and iSrcB are input port, input respectively two multipliers; ORes is output port, the result that output iSrcA and iSrcB multiply each other.
In Fig. 6, Clk is input end of clock, Rst_n is the RESET input, Light_en is for enabling input end, Iatm, Idif, Ispc, Iemi is respectively the surround lighting composition, composition diffuses, the input end of specular light composition and utilizing emitted light composition, Ka, Kd, Ks is respectively body surface reflection of ambient light coefficient, coefficient diffuses, the input end of specular light coefficient, Ns is body surface minute surface index input end, Vert_cord, Lgt_cord, View_cord is respectively the body surface point coordinate, the light source coordinate, the input end of observation point coordinate, the normal vector input end that N_drct is body surface point, Wrt_en is the output enable end, the output terminal that I_o is the lighting effect that finally obtains.
The present invention can pass through or adopt existing techniques in realizing without the technical characterictic of describing; do not repeat them here; certainly; above-mentioned explanation is not limitation of the present invention; the present invention also is not limited in above-mentioned giving an example; the variation that those skilled in the art make in essential scope of the present invention, remodeling, interpolation or replacement, also should belong to protection scope of the present invention.

Claims (7)

1. the system based on look-up tables'implementation BlinnPhong illumination model, is characterized in that, comprising:
Look-up table means: realize the calculating of complex mathematical expression formula in the BlinnPhong illumination model, comprise square root calculation reciprocal, the computing of taking the logarithm, power side's computing of 2; Also comprise:
Vector module: realize in the BlinnPhong illumination model vectorial operation is comprised to vectorial plus-minus;
Product module: realize the computing of product in the BlinnPhong illumination model;
Register module: the data that in the BlinnPhong illumination model, each step calculates are preserved and transmitted;
Main control module: the distribution to each calculation procedure and hardware resource in the BlinnPhong illumination model is dispatched, and realizes effectively controlling at a high speed.
2. the system based on look-up tables'implementation BlinnPhong illumination model according to claim 1, is characterized in that, the quantity of described look-up table means is 1, and the quantity of described vector module is 2, and the quantity of described product module is 3.
3. the system based on look-up tables'implementation BlinnPhong illumination model according to claim 1, it is characterized in that, described look-up table means completes single job needs 5 clock period, described vector module completes a vector operations needs 3 clock period, and described product module completes a multiplication operations needs 1 clock period.
4. the system based on look-up tables'implementation BlinnPhong illumination model according to claim 1, it is characterized in that, described look-up table means comprises iSclk input end of clock mouth, iOpcode compute mode input port, iSrcA, iSrcB, iSrcC primary operand input port and oLutRes look-up table output port as a result.
5. the system based on look-up tables'implementation BlinnPhong illumination model according to claim 1, it is characterized in that, described vector module comprises iSclk input end of clock mouth, iOpcode vector operations mode input port, iSrcA, iSrcB, iSrcC vector input port and oVecRes output port.
6. the system based on look-up tables'implementation BlinnPhong illumination model according to claim 1, it is characterized in that, described main control module comprises the Clk input end of clock, Rst_n the RESET input, Light_en enables input end, Iatm, Idif, Ispc, Iemi surround lighting composition, composition diffuses, the input end of specular light composition and utilizing emitted light composition, Ka, Kd, Ks body surface reflection of ambient light coefficient, coefficient diffuses, the input end of specular light coefficient, Ns body surface minute surface index input end, Vert_cord, Lgt_cord, View_cord body surface point coordinate, the light source coordinate, the input end of observation point coordinate, the normal vector input end of N_drct body surface point, the output terminal of the lighting effect that Wrt_en output enable end and I_o finally obtain.
7. the method based on look-up tables'implementation BlinnPhong illumination model, is characterized in that, comprises the steps:
(1) when the main control module calls look-up table means is calculated, according to circumstances Selection and call vector module or product module;
(2), if what call is vector module, according to circumstances select whether to call the product operation simultaneously;
(3) repeating step (1) and (2), until complete all calculating of BlinnPhong illumination model.
CN201310438929.8A 2013-09-22 2013-09-22 A kind of design system based on look-up tables'implementation BlinnPhong illumination model Expired - Fee Related CN103440395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310438929.8A CN103440395B (en) 2013-09-22 2013-09-22 A kind of design system based on look-up tables'implementation BlinnPhong illumination model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310438929.8A CN103440395B (en) 2013-09-22 2013-09-22 A kind of design system based on look-up tables'implementation BlinnPhong illumination model

Publications (2)

Publication Number Publication Date
CN103440395A true CN103440395A (en) 2013-12-11
CN103440395B CN103440395B (en) 2016-08-10

Family

ID=49694088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310438929.8A Expired - Fee Related CN103440395B (en) 2013-09-22 2013-09-22 A kind of design system based on look-up tables'implementation BlinnPhong illumination model

Country Status (1)

Country Link
CN (1) CN103440395B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699733A (en) * 2013-12-19 2014-04-02 山东大学 Illumination model system and implementation method
CN104239647A (en) * 2014-09-25 2014-12-24 山东大学 Hardware design structure realizing light ray tracking

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070271080A1 (en) * 2006-05-16 2007-11-22 Fujitsu Limited Model generation method for software/hardware collaboration design
CN102063528A (en) * 2010-12-20 2011-05-18 西安电子科技大学 Method for extracting rhombus redundant filling parasitic capacitance based on lookup table algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070271080A1 (en) * 2006-05-16 2007-11-22 Fujitsu Limited Model generation method for software/hardware collaboration design
CN102063528A (en) * 2010-12-20 2011-05-18 西安电子科技大学 Method for extracting rhombus redundant filling parasitic capacitance based on lookup table algorithm

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘斐 等: "基于线性分类器的混合空间查找表颜色分类方法", 《中国图象图形学报》, vol. 13, no. 1, 31 January 2008 (2008-01-31), pages 104 - 108 *
王骏 等: "基于图像的光照模型的研究与实现", 《计算机工程与设计》, vol. 26, no. 1, 31 January 2005 (2005-01-31), pages 267 - 269 *
陈家新 等: "一种改进的 Phong光照模型及光线跟踪实现", 《系统仿真学报》, vol. 14, no. 12, 31 December 2002 (2002-12-31), pages 1642 - 1646 *
马国军: "体素分类与Phong光照模型GPU加速体绘制", 《计算机工程与设计》, vol. 31, no. 7, 16 April 2010 (2010-04-16), pages 1529 - 1532 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699733A (en) * 2013-12-19 2014-04-02 山东大学 Illumination model system and implementation method
CN104239647A (en) * 2014-09-25 2014-12-24 山东大学 Hardware design structure realizing light ray tracking

Also Published As

Publication number Publication date
CN103440395B (en) 2016-08-10

Similar Documents

Publication Publication Date Title
Guo et al. Software-hardware codesign for efficient neural network acceleration
CN105468335B (en) Pipeline-level operation device, data processing method and network-on-chip chip
CN109543832B (en) Computing device and board card
CN103970720B (en) Based on extensive coarseness imbedded reconfigurable system and its processing method
CN108898554A (en) Improve the method and Related product of image resolution ratio
CN109447241A (en) A kind of dynamic reconfigurable convolutional neural networks accelerator architecture in internet of things oriented field
CN104915322A (en) Method for accelerating convolution neutral network hardware and AXI bus IP core thereof
Nagasu et al. FPGA-based tsunami simulation: Performance comparison with GPUs, and roofline model for scalability analysis
CN115880132B (en) Graphics processor, matrix multiplication task processing method, device and storage medium
KR20190107091A (en) Calculation device and method
CN110163357A (en) A kind of computing device and method
CN102314330B (en) Composite finite field multiplier
CN103699733A (en) Illumination model system and implementation method
CN103440395A (en) Design system and method for realizing BlinnPhong illumination model based on lookup table
US11651198B2 (en) Data processing method and apparatus for neural network
CN107092462B (en) 64-bit asynchronous multiplier based on FPGA
CN109960836A (en) A kind of method, apparatus and terminal device of turbulent wake emulation
CN202217262U (en) Composite finite field multiplying unit
CN103955585A (en) FIR (finite impulse response) filter structure for low-power fault-tolerant circuit
CN115408061B (en) Hardware acceleration method, device, chip and storage medium for complex matrix operation
CN109460535B (en) Finite field matrix inversion device and inversion method based on cloud
Wu et al. An efficient lightweight CNN acceleration architecture for edge computing based-on FPGA
CN102932645B (en) The circuit structure that a kind of graphic process unit and Video Codec merge
CN109993290A (en) Integrated circuit chip device and Related product
CN105278914B (en) Configurable floating point vector norm based on FPGA solves IP kernel

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Sun Runyuan

Inventor after: Sun Tao

Inventor after: Zhou Li

Inventor after: Gao Yuanyuan

Inventor before: Sun Tao

Inventor before: Zhou Li

Inventor before: Gao Yuanyuan

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160810

Termination date: 20170922