uname -r
Note: On SGI R5000, R8000, or R10000 series machines, you must render with one of the .5k renderers. On an SGI R4000 series machine, you must render with one of the .4k renderers. In both cases, the Makefile should be edited to reflect the type of machine you are running on.
The Alias OpenRender software is installed as part of the 8.0 Alias software installation. The software is installed in /usr/aw/alias/ODS/OpenRender. If you have not installed the software in /usr/aw/alias, replace all references to /usr/aw/alias with the appropriate directory for your machine.
To use Alias OpenRender copy the software from /usr/alias to your local directory. For example:
cd $HOME
mkdir openrender
cd openrender
cp -r /usr/alias/ODS/OpenRender .
The most significant change is to the .c.o rule. In this rule is the statement
ld -shared $*.o -o $*.so
OCR_OBJ=SChecker.o \
rainbow_light.o\
gs_light.o\
gs_shader.o
all: $(OCR_OBJ)
CFLAGS=-G 0 #irix
LDFLAGS=-lm #irix
.c.o:
cc $(CFLAGS) -c -I. -I.. -I$(ALIAS_LOCATION)/include $*.c
ld -shared $*.o -o $*.so
rm $*.o
mv $*.so $*.o
test: ./pix testS testbow testgs
echo 'Renderer Test Successful'
testgs: gs_light.o gs_shader.o
renderer $(ALIAS_LOCATION)/sdl/gs_trims0.125
echo
testbow: rainbow_light.o
renderer $(ALIAS_LOCATION)/sdl/rainbow
testS: SChecker.o
renderer $(ALIAS_LOCATION)/sdl/SChecker
./pix:
mkdir ./pix
clean:
rm -f $(OCR_OBJ) pix/BALL.SChecker "ocra*"
mkdir ocr <CR>
Change into the directory :
cd ocr <CR>
cp /usr/aw/alias/ocr/samples/* .
make test
Render Test Successful
/usr/aw/alias/ODS/OpenRender/samples). Each example has a file with a .README suffix which explains the purpose of the example.To try out one of the examples, check each .README file to determine which files from the directory constitute the given example.
Copy the files listed in the example's .README to a test directory. With the exception of Tfizzle, all the examples use the same makefile. For Tfizzle, follow the steps outlined in the Tfizzle.README file.
For examples other than Tfizzle, type :
make <example>.o
While the example will prove to be useful in understanding the rendering process, it may be easier to use the Alias-supplied templates as a starting point for your own development.
Three template files (simple_light.c, simple_shader.c, simple_texture.c) are provided in the templates directory. Use the makefile supplied in the samples directory to create your own modules.
If you have produced
/u/joe/mylight.o you might use the following SDL:
create light (model=mylight, filename="/u/joe/ mylight.o");
setenv ALIAS_OCRPATH /u/joe/
create light(model=mylight, filename="mylight.o");
ocra0012. This file can simply be deleted. Do not delete this file while OpenRender is running; it should be automatically deleted once the rendering process has finished.
float TDblurmult;
float TDbluroffset;
In your actual texturing code, if you previously had:
int CALC (AR_TextureData *texture)
{
blurmult = texture->TDdata->blurmult;
bluroffset = texture->TDdata->bluroffset:
}
int CALC (AR_TextureData *texture)
{
blurmult = texture->TDblurmult;
bluroffset = texture->TDbluroffset;
}
AR_Boolean computed_cosln;
float cosln;
AR_Boolean force;
The force boolean is used to allow the light to inform the shader if it is a force. This flag should be set to FALSE before the call to the light->calc() routine. Failure to do so may result in your shader returning no color at all.
There are four new fields in AR_ShadeData. They are meant for the rendering of "shadow catchers". By a shadow catcher, we mean that the shading for the surface is ignored and the background color is used instead, with only shadowing and reflection accounted for. This allows the user to place fake objects that catch shadows and reflections in order to blend Computer Graphics objects with live action plates and backgrounds. The four parameters are:
AR_Boolean background_colour;
AR_Rgba matte_light;
AR_Rgba matte_shadow;
AR_Rgba matte_reflection;
The background_colour field indicates whether the current shader is a shadow catcher. If FALSE, then the remaining three fields are irrelevant. Otherwise, matte_light is the total light intensity collected for this shader, matte_shadow is the total shadow occlusion fraction (out of the total matte_light intensity), and matte_reflection is the mirror reflection result. Then the shading is done as follows:
shading result = matte_shadow / matte_light * background +
matte_reflection
The support provided includes answering questions on the use of the interface routines and their calling parameters, include files and libraries. You will be able to get help understanding Alias defined data structures and types, and advice on the correct approach to the problem you're trying to solve given our knowledge of the inherent capabilities of OpenModel/OpenAlias. We will also be able to explain the source code examples provided so that you have a full understanding of what you are building on.
Please note however that OpenModel/OpenAlias support through Assist is not a general consultation service to help debug non-API related problems, such as algorithms or NURBS math.
Alias Assist
VOICE (416) 362-8670
FAX (416) 362-1276
The flow of the renderer is not changed for ALIAS OpenRender. When the renderer encounters a user-defined shader, light, or texture, control is passed to the ALIAS OpenRender function you've created. These functions process the data passed to them, then return control to the Alias renderer.
Since much of what must be written for an ALIAS OpenRender code module is repetitive, we have provided you with several simple examples that you can copy and modify for each shader, light, or texture that you write. These templates define six of the nine functions required for each ALIAS OpenRender C code module. You must write the three remaining functions and two data structures. The two data structures allow you to extend the syntax of SDL inside of your new shader, light, or texture. The fields that you add to your data structures can be bound to new SDL keywords that you create, and the Alias Renderer automatically parses (reads from the file) and evaluates (determines their values) for you.
This document gives you: