Вы находитесь на странице: 1из 7

Comput. & Graphics, Vol. 20, No. 2, pp.

191497, 1996
Copyright 0 1996 ElsevierScienceLtd
Printed in Great Britain. All rights reserved
0097-8493/96 515.00+ 0.00
0097-8493(95)00125-5

Techniques for Virtual

DISTRIBUTED

Environments

GRAPHICS
SUPPO:RT FOR VIRTUAL
ENVIRONMENT!3

ZHIGENG PAN, JIAOYING SHI+ and MINGMIN

ZHANG

State Key Lab of CAD & CG, Zhejiang University, Hangzhou 310027, Zhejiang, China
e-mail: cad-wlcai@zunet.ihep.ac.cn
Abstract-The
networked workstation system is one of the commonly used Virtual Environment (VE)
hardware platforms. In this paper we discuss distributed graphics support for implementation of VE
systems and present an experimental environment called DGPSE + . It provides four kinds of consistency
control methods: mutual exclusion, centralized controller, sequential ordering, and distributed lock. To
meet the real-time requirement of VE systems, DGPSE+ containsa setof parallelgraphics
rendering
algorithms with different computation requirement. A distributed stereoscopic graphics rendering is also
included. It can find out idle or near idle workstations to execute the parallel algorithms. DGPSE + has
advantages such as multiple consistency control mechanisms and powerful graphics rendering support
capability. Copyright 0 1996 Elsevier Science Ltd

1. INTRODUCTION

A virtual environmentprovidesa uniquemediumfor


embeddingoperators within a synthetic workspace.
The degree of involvement may be total as in
rehearsalactivity for missionexecution or partial as
in a spacestation repair or medicaltelesurgery[l]. In
such environmentsa wide-field-of-view stereoscopic
head-tracked display systempresentsa compelling
illustion of a 3-D world generatedby the computer
graphics [2]. The researcherfeelsimmersedin this
world, which is populated by computer generated
objectsthat appearand behaveasif they were real.
This 3-D display provides many depth cuesthat we
usein the real world, suchasbinocular disparity and
head-motion parallax, providing a display of 3-D
structures that overcome many of the ambiguities.
The display devicetracks the usersheadandcontrols
the point of view of the computer generatedscene.
Using a 3-D input device, the researchercan directly
manipulatea virtual objectsposition and orientation
in 3-D.
VE technology has been successfullyapplied to a
variety of areas such as scientific visualization,
entertainment and recreation, art design, training,
CAD, medical telesurgery, military systems
and
telecommunications[3]. The recent achievementhas
placed extreme pressureon conventional graphics
systemsto provide realistic real time graphics. In
order to maintain the illusion of immersionin a
virtual world the user must continually seeimages
from his own vantage point. Any delays between
changesin the usersheadposition and the display of
imagesfrom that position are very noticeable. To

+ Author for correspondence.

minimize this delay extremely powerful rendering


enginesare required[4].
There are four commonly used VE computing
architectures[5]: PC-basedVE engine,workstationbased VE (engine,highly parallel VE engine and
distributedVE. In this paper,we aim at the platform
of distributed VE system.
The computational load distribution is required
owing to the VE simulationreal-timecharacteristics.
The first three architectureslisted above distribute
the load amongmultiple boardsof a singlemachine.
Another approach to load distribution is to divide
the tasksamongseveralworkstationscommunicating
over a high-speednetwork. Network distribution has
the advantagethat existing computerscan be usedin
the simulationwithout having to purchasededicated
VE workstations.Another advantage is the feasibility
of remote computer accessand participation in the
simulation. This in turn makespossiblemulti-user
VE simulations. The need for distributed VE in
military applicationshas already been well demonstrated in applicationssuch as flight simulatorsand
tank combat simulations[6].
In somedistributed VE systems, the Client-Server
approach is used. The server is the central workstationcoordinatingmostof the simulationactivities.
It hasthe responsibilityof maintainingthe stateof all
of the virtual objects in the simulation.
Client
processes
manage
the local simulations,interact with
I/O tools and perform graphicsrendering. In cases
when the servers themselvesare distributed, each
server coordinatesthe simulation at a different site,
asillustrated in Fig. 1 [7].
In designingdistributed VE systems,one important issueis How can we bestexploit the potential of
a large number of networked computers to meet realtime requirements
of multiple interacting users and

191

Z. Pan, J. Shi and M Zhang

192

(b)
Site A

Fig. 1. Non-distributed/distributed

Site B

, Virtual World

servers: (a) non-distributed

applications? [S]. To solve this problem many


researchworks have beendone. Examplesare dVS
[9], VR-DECK [lo], BrickNet [I I], MR Toolkit [12]
and so on.
Networked VE systemsare a typical applications
of distributed graphics [13]. As we know, it is far
more difficult to designdistributed graphicsrendering programsthan to designprogramsrunning on a
singleprocessor.The reasonis that severalproblems
derived from distributed environment must be
considered[13, 141: task partition and allocation,
communication, synchronization, protection of
shared resources, consistency control and load
balancing. To solve these problems, we need an
environment to support the developmentof distributed VE systems.Such an environment can reduce
the amount of developmentwork and allows the
scientiststo tackle a wider-rangeof applications.
The rest of the paper is organized as follows. In
Section2, we discussthe distributed graphicssupport
requirementsfor VE and designconsiderationsare
presented.The existing distributed graphicsproccssing support environment, called DGPSE [14], is
extended for a distributed VE system. In Section 3,

server; (b) distributed servers.

some technical aspectsof the implementation are


detailed.Section4 containsconcludingremarks.

2. SUPPORT

RRQUtREMJZNTS
CONSIDERATION

AND

DESIGN

2.1. Support requirements

Distributed VE systemsuse either a non-distributed serverarchitecture(centralizedarchitecture)or a


distctbuted server architecture (replicated architecture), and they can be divided into two groups:
systemswith identical local databasesand systems
with different local databases[3]. In spite of the
different architecturesused by distributed VE systems, the following support capabilities should be
provided by the underlying environment: communication, consistencycontrol, real-time control and
powerful graphicssupport.
In distributed programming, processesof one
distributed program complete the samework cooperatively. Thus communication is needed to
coordinateindividual progressand exchangedata if
necessary.There are two kinds of communication:
syndhronous

and asynchronous.

Distributed graphics support


Consistency control or concurrence control is
needed to solve conflicts between participants
simultaneous operations. Different applications may
need different consistency control schemes [3]. The
consistency control scheme that is best for one
application may not necessarily suit other applications as well. It is not practical to find a generic
control scheme for every type of application; instead,
we implement several control schemes for users
choice.
The primary potential benefits of distributed
computation are to increase computation capability,
to broaden disk bandwidth, and to extend physical
memory capacity. The costs are network communication time and access time when the remote system
is a heavily used supercomputer. These costs and the
computation needed for rendering complex scenes
affect the real-time property of VE systems.
Real-time graphics rendering is one of the important factors for evaluating VE systems. There are
many methods to satisfy real-time requirements. For
example, we may use multiple machines to compute
parts of virtual worlds. We may draw a conclusion
that stereoscopic graphics rendering, parallel graphics rendering and algorithms for generating
graphics objects with various qualities should be
provided by the underlying environment.
2.2. Overview of DGPSE

DGPSE was designed and implemented on a


heterogeneousnetwork consisting of Sun Spare
workstations and HP workstations in 1993. It
supportsseveralkinds of distributedparallelcomputing paradigm such as ClientServer, Master-Slave
(also called Supervisor-Worker) and SupervisorWorker-Collector. DGPSEs functions include distributed processingsupport (processschedule,communication, detection of termination, error report,
idle workstation finding and so on), graphicsprocessing support and debuggingfacilities.
2.2.1. Process schedule. When a distributed program is executed,it forks many processes
which can
run in parallel on many machines.Two methodsare
used frequently for process distribution: static
allocation and dynamic allocation. In static allocation programmersor usersdecide the processorto
run the particular process.In dynamic allocation the
systemautomatically decidesthe processorto execute
the particular processaccording to conditions of
availableprocessors.DGPSE supportsboth methods
of processdistribution to provide more flexibility.
2.2.2. Process communication. Asynchronousmessagepassingis used in DGPSE for three reasons.
First, it is the most flexible mechanism.Second,
asynchronousmessagepassingis the most natural
approach to graphicsprogramming.Third, sincean
acknowledge messageis not needed, the total
messagenumber is lessthan that of synchronous
message
passing.
2.2.3. Graphics support. Another major component
of DGPSE is its graphicslibrary called DGPSL [IS]
CAG
z0:z.B

193

that consistsof a sequentiallibrary and a parallel


graphicslibrary. A sequentiallibrary is similarto GL
of SGI. Algorithms in a parallel library can be
executedin parallel on a set of machines.
2.2.4. Debugging facilities. In our experience,one
difficulty for debuggingprogramsbasedon DGPSE
is that we are unable to assurewhether the desired
communicationoperationshave happened.To solve
this problem, we provide somedebuggingfacilities,
which include network visualization (network linkage,load cf every workstation), displaying of mailbox contents,recordingof communicationoperation,
and checkingof waiting process.
2.3. Extension

to DGPSE

According to the introduction in Section 2.2,


DGPSE has limited support for distributed VE
systems.Therefore, someextensionswere made to
DGPSE and we got DGPSE+ These extensions
include multiple consistency control mechanisms,
various parallel shading algorithms, distributed
stereoscopicgraphicsrenderingand so on.
2.3.1. Consistency control. As statedin Section2.1,
we need to provide severalmechanismsthat ensure
consistencyin the replicateddatabase.Four mechanisms are implemented: mutual exclusion [16, 171
centralizedcontroller [111,sequentialordering[3] and
distributed locks [17].
The mutual exclusion mechanismprevents concurrent modification of the local database by
separatelightweight threads. The mutual exclusion
algorithm implementedin DGPSE+ is detailed in
Section3.1.
The centralized controller method implements
consistency control by introducing a centralized
controller processassumingthat data is duplicated
over all workstations.The controller receivesa user
requestfor operation and broadcaststheserequests
to all users. Because the same operations are
performedin the sameorder for all users,all copies
of the data mmainthe same.
In sequentialordering,the underlying environment
ensurs that messagessent from a single process
alwaysreachall recipientsin the order they weresent.
Distributed lock is on the object (a shared
resource)level. It ensuresthat only one processat a
time may modify one object. By placinga distributed
object lock on an object, a processcan manipulatean
object exclusively in the local database,and then
distribute the changes.All processes
trying to achieve
the lock will block until the holding processreleases
that lock.
2.3.2. Various shading algorithms. In computer
graphics, the image generation processhas to be
tuned to the specificneedsof the application.A range
of renderingmodelshave emerged,eachwith specific
features and each of which tries to approximate
physically correct imagesat different levels.
Sometimes,even with parallel processing, the
renderingtime of specificscenesis not acceptablein
VE systems.To solve this problem, we usevarious

194

Z. Pan. J. Shi and M. Zhang

rendering algorithms. The idea behind this technique


is to trade image quality for interactivity in situations
where the environment is too complex to be rendered
with high quality.
We have implemented a set of graphics rendering
algorithms on a Sun Spare workstation, including
flat-shading, Gouraud-shading, Phong-shading, and
ray tracing. These algorithms generate images with
different levels of quality. Of course, the computation
cost varies greatly. The users of DGPSE+ or the
system may select one of these algorithms to render
the particular scene according to the complexity of
the scene and the allowed time.
2.3.3. Stereoscopic graphics rendering. Stereoscopic
graphics adds some additional depth cue [18].
Producing a stereopair is a relatively simpleprocess.
Rather than simply rendering a single image one
createdtwo related images.The imagesmay then be
viewed on a stereomonitor or by using glasses
with
specialfilters.
3. IMPLEMENTATION

EXPERIENCE

DGPSE+ wasimplementedon a network of Sun


Spareworkstations,HP workstations,IBM RS-6000
workstations and SGI workstations.Currently there
are 28 workstations in total.
3.1. Consistency control mechanisms implementation

Four consistencycontrol mechanisms


are provided
in DGPSE+ . In the following, we use mutual
exclusionasan exampleto detail the implementation
method.
3.1.l. Symbols definition. To describethe mutual
exclusionalgorithm, we definethe following symbols.

(d) Release

0perateonCS;
Executing=FALSE;
CS
for everysiteSkinIi
Si) do
{Ii-Ii-[Sk];
sendRELEASE(Ci,i)
task;
Ri-Ri+[Sk];
1

(except

message

In -he first stepof the algorithm, someinitial state


variables are set; in the secondstep, Si acquires
permissionto execute CS from all the sites in its
requestset Ri; in the third step, it executesCS; and
in the fourth step, it releasesthe CS by sendinga
RELEASE message
to all the sitesin its inform set
Ii.
Becausethere are two kinds of messages
in the
algorithm, two messagehandlersare required. The
REQUEST messagehandler at a site processes
incomingREQUEST message.
It takes actionssuch
as updating the information set and sending REQUEST/RELEASE messagesto other sites. The
RELEASE messagehandler at a site processes
incoming RELEASE messages.It updates the
information set. Note that REQUEST/RELEASE
messa.ge
handlersand the stepsof the algorithm (step
(b), (c), and (d)) accessshared data structures. To
guaranteethe correctness,we requirethe executionof
REQIJEST/RELEASE messagehandlers and step
(b), (I:) and (d) of the algorithm mutually exclude
eachother.
3.2. Distributed

graphics library

DGPSL is a facility that allows a processon one


CS: critical section(sharedobjects)
machme
to use multiple other machines on the
Si(i=l, . . . . n): the geographically dispersed
network
to
perform graphics computation. It has
autonomous sites (workstations) communicating
four
major
parts:
over high speed network (n is the number of
workstation in the network).
A calling interfacelinks with application programs
Ii (inform set): containsthe sitesto which Si must
that serve as the API between DGPSL and
sendits permissionto executeCS.
programmers.
Ri (requestset): contains the sitesfrom which Si
A distributed graphics server which servicesthe
must acquirepermissionbefore executingCS.
requestissuedby the graphicsprogram.
Ci: logical clock of Si. Every requestfor executing
SGL in which there area setof sequentialgraphics
CS is assigneda timestamp, which is used to
algorithms.
determineits priority. The smallerthe timestamp
PGL in which there are a set of parallel graphics
of a request,the higher its priority.
algorithms.
3.1.2. Algorithm. Site Si executesthe following
The calling interface converts the graphicslibrary
stepsto invoke mutual exclusion.
callsinto messages
and sendsthem to the distributed
(a) initialize
graphicsserver over the Ethernet with the commu(b) Request
CS
nicati,on facility provided by the underlying
Requesting=TRUE;
DGPSE+ environment. The distributed graphics
Ci=Ci+l;
server decodesthe messages,
finds appropriate idle
sendREQUEST(Ci,i)
message to
workstationsif necessary,callsthe graphicsroutines
allthesitesinRi;
in SGL or PGL, and displaysthe graphics on the
WAITUNTILRi==null;
specifiedrastersubsystem.The wholecall mechanism
Requesting=FALSE;
is shownin Fig. 2.
(c) Execute
CS
The graphics routines implementedin SGL and
Executing=TRUE;
PGL include clipping, hidden line and surface

- _ __. _ _.-.__- __..

Distributed graphics support


r - _-._ _ _ . ..-.__

195

[ graphics
I application 2
1
.!
:
i

calling
interface

.!
les
- Isa e

Ethernet

computing
server 1
i---l
Fig. 2. Call mechanism of DGFSL

removal, 3-D scan conversion, shading (flat, Gouraud, Phong), ray tracing and radiosity rendering. For
example, if one needs to use ray tracing routine in
SGL, he can use the call of the following form:

We adopt the distributed computing paradigm


called Supervisor-Worker [13, 191to implementthe
algorithm. The left-eye view and the right-eye view
arecomputedindependently.Imagespaceparallelism
[20] is exploited. The imagespaceis partioned into
sgl-raytrace(scene-descriptionfile,
small squares(for example, 16x 16 pixels), and
display- processor-name, . . .)
imagescorrespondingto each squareare computed
If one needsto use the ray tracing routine in PGL, by different workstationsin the network.
There are two types of processes
in the algorithm
the call may look asfollows:
(see Fig. 3). A supervisor process runs on the
pgl-raytrace(scene-descriptionfile,
supervisingworkstation. It is responsiblefor maindisplay- processor-name,
. .)
taining global data structure and partitioning the
In DGPSL we useCSG and polyhedral expression overall renderingprobleminto smallproblemswhich
to describethe scene.Usersmay useeither of them are handed to Worker processesfor computation.
accordingto the format specifiedby DGPSL and call The number of Worker processesdependson the
the graphics generation function in SGL or PGL. numberof idle workstationsavailable.
3.3.1. Symbols definition.
The display-processor-name
above is usedto specify
Wi(i= 1, . _, n): workstation in the network, n is
the machine on which the generated picture is
the total number.
displayed. Its default value is the user workstation
IW: idle or near idle workstation set.
name.
TS:
subtaskor subproblemset.
To support the execution of graphics routine in
LP: parameterset for left-eye view.
parallel, we implement an algorithm based on a
RP: parametersetfor right-eye view.
centralized schedulemechanismfor finding idle (or
3.3.2. Algorithm.
near idle) workstations in the network [13]. Each
machinein the network sendsits state modification Supervisor
Process:
information (load) to the central serverif necessary. BEGIN
The client program sendsa request to the central
Initialize;
IW=find--idle-workstations
server for one or several idle workstations. The
0;
central server selectsidle workstations basedon the
activate-workergrocesses
(IW) ;
state information of all machines.The algorithm has
TS=partition-task)scene-f
ile,LP,RP,
imaqe__resolutionf;
the following advantages:(1) responsetime is fast; (2)
the numberof workstationsis easyto enlarge;and (3)
REPEAT
it can find more than oneidle workstation eachtime.
SELECT
3.3. Parallel

stereoscopic graphics rendering algorithm

As we know, stereoscopicgraphics rendering is


time consuming.To reducethe imagegenerationtime
we implementeda distributed stereoscopicrendering
algorithm. The algorithm may usetwo or more idle
workstations in the network to render two different
views. The workstation number usedis only limited
by the total numberof idle workstations.

IF (mailbox-not-empty)
THENreceive
worker-no,
result);
IF (result<
>nulll)
THENrecord
(result);
put-worker-in-queue(worker_no);
OR
WHENzubproblems-available
worker-no=get-worker_from_queueO;
subproblem=get-task(TS);

196

Z. Pan, J. Shi and M. Zhang

task allocation

resul
Worker Process
compute

image
Fig. 3. Supervisor-Worker

delete-subproblem(
send(workergo,subproblem);
UNTILdone;
assemble-result;
finalize;
END.
WorkerProcess:
BEGIN
result=null;
LOOP BEGIN
send(supervisor,
result);
WAITmailbox-not-empty;
get~subproblem~from~mailbox;
result=render(subproblem);
END
END.

To keep the communication down to one request


message from Worker to Supervisor and one reply
message from Supervisor to Worker, a null result is
sent as the first message from Worker to Supervisor
to start things off. Subsequently, each result requests
a new subproblem.
Adelson and Hedges [ 181describe a new method to
create an approximate stereoscopic pair by transforming a fully left-eye view into an inferred right-eye
view. And the second view can be computed with as
little as 5% of the effort required to render the First
view. Now we are designing and implementing a
parallel version of this algorithm to reduce the stereo
graphics rendering time greatly.

process

the described environment is a low level tool for


distributed VE systems.
Acknowledgements-We
are grateful
to Aidong Zhiqiang
Lao, Miao Xu and Xiaohu
Ma in our research team for
their .help. Thanks also go to Mr Wenli Cai for his
suggestions in the preparation
of the paper. Special thanks
is due to Wenting Zheng for his help in implementationof

DGPSL and idleworkstations finding algorithm. This work

is supported
China.

5.
6.

I.

8.
9.

10.

4. CONCLUSIONS

In this paper, we address the problem of distributed graphics support for VE systems. Some extensions have been made to the existing distributed
graphics processing support environment. Compared
with other systems or tools for development of
distributed VE systems, DGPSE+
has obvious
advantages such as powerful distributed graphics
rendering support and more parallelism. However,

structure.

11.

12.

13.

by the National

Nature

Science Foundation

of

REFERENCES
R. S. Kalawsky,
The Science of Virtual Reality and
Virtual Environments,
Addison-Wesley
(1993).
S. Bryson,
Virtual
reality
in scientific
visualization.
Computers
& Graphics 17, 678-685 (1993).
Q. Wang, Networked
Virtual Reality,
Master
Thesis,
University
of Alberta (1994).
M. Regan and R. Pose, Priority rendering
with a virtual
reality address recalculation
pipeline,
SZGGRAPH94
Proceedings,
55-162 (1994).
G. Burdea and P. Coiffet, Virtual Reality Technology,
Jo:hhn Wiley & Sons, Inc. (1994).
E. A. Auisi,
The development
of technology
for
co:Uective training:
SIMNBT,
a case history.
Human
Factors 33, 343-263 (1991).
K. Pimenteland K. Teixeira, Virtual Reality:
Through
the New Looking
Glass, McGraw-Hill,
New York
(1993).
S. Bryson and S. K. Feiner, Research frontiers in virtual
reality, SZGGZUPH94
Proceedings,
473-474 (1994).
C. Grimsdale,
dVS-distributed
virtual
environment
system, Proceedings
of Computer Graphics.91
Conference, London (1991).
C. F. Codella, R. Jalili, L. Kaved, and J. B. Lewis, A
toolkit
for developing
multi-user
distributed
virtual
environments,
IEEE
Virtual Reality
Annual Znternational Symposium93,
401-407 (1993).
G. Singh,L. Serra,W. Png,and H. Ng, BrickNet:
a
software toolkit for network-based
virtual worlds. In
PRESENCE:
Teleoperators
and Virtual Environments,
MIT Press (1994).
M Green, C. Shaw, and L. White, Minimal
reality
toolkit, version 1.3, Department
of Computing
Science,
University
of Alberta (1993).
Z. Pan, Distributed
graphics
processing:
theory
and
application.
Ph.D.
Dissertation,
Zhejiang
University
(1993).

Distributed graphics support


14. 2. Pan, J. Shi, and Z. He, A distributed graphics
processing support environment. Chinese Journal of
Advanced Software Research, 2, 161-168 (1995).
15. J. Shi, Z. Pan, and W. Zheng, DGPSL: a distributed
graphics library. CADDM 4, 50-58 (1994).
16. M. Singhal, Dynamic information-structure
mutual
exclusion algorithm for distributed systems. IEEE
Transactions on Parallel and Distributed Systems 3,
121-125 (1992).
17. C. Carlsson and 0. Hagsand, DIVE-a platform for

197

multi-user virtual environments.. Computers & Graphics


17, 663669 (1993).
18. S. J. Anderson and L. F. Hedges, Stereoscopic raytracing. The Visual Computer 10, 127-144 (1993).
19. J. N. Magee and S. C. Cheung, Parallel algorithm
design for workstation clusters. Software-Practice and
Experience 21, 235-250 (1991).
20. S. Whitman, Computer graphics rendering on a parallel
processor. Course Notes for SIGGRAPH90, Course 28,
167-184 (1990).

Вам также может понравиться