Setting up Your Development Environment

This section describes the Softimage libraries you should link to for successful compilation.

• Windows

• Linux

Refer to the Programming mental ray guide (available on the Softimage Documentation CD) for additional information about compiling shaders for various platforms.

Refer to the mental ray manual (available under $factory/Doc/mental_ray/manual) for additional information about compiling shaders for various platforms or the Programming Mental Ray manual published by mental images.

Windows

Starting Visual Studio .NET

You should start Visual Studio .NET from a Softimage command prompt. This ensures that the Softimage environment variables (such as XSISDK_ROOT) are inherited by Visual Studio .NET.

The Visual C++ projects (.vcproj) generated by the shader wizard use the XSISDK_ROOT environment variable to specify the locations of include files and libraries.

Project Configuration Properties

If you do not use the shader wizard to generate your Visual C++ project, then you’ll need to set the following project configuration properties.

Property | Values
C/C++ > General > Additional Include Directories | $(XSISDK_ROOT)\include\
C/C++ > Code Generation > Runtime Library | Multi-threaded DLL (/MDd) - or - Multi-threaded Debug DLL (/MDd)
Linker > General > Additional Library Directories | $(XSISDK_ROOT)\lib\nt-x86 -or- $(XSISDK_ROOT)\lib\nt-x86-64
Linker > Input > Additional Dependencies | • shader.lib

To make the location of the include and library directories available in all projects, you can add these directories to the global VC++ Directories.

In Visual Studio .NET, click Tools > Options, expand Projects, and click VC++ Directories. In the Show directories for list, click Include files and add the $(XSISDK_ROOT)\include folder. Then, in the Show directories for list, click Library files and add the location of shader.lib.

Linux

The shader wizard generates a makefile for you:

    #!/usr/bin/make

    # Makefile Generated by Softimage Shader Wizard

    SRCS := MyTestShader.cpp
    RESULT := MyTestShader.so

    LIBS := -lm

    OBJDIR := obj
    OBJS := $(patsubst %.cpp,$(OBJDIR)/%.o,$(filter %.cpp,$(SRCS)))

    CXXFLAGS := -I $(XSISDK_ROOT)/include

    ifdef DEBUG
    CXXFLAGS += -g
    endif

    all: $(RESULT)

       install: $(RESULT)

    $(OBJDIR)/%.o: %.cpp
       @if [ ! -d "$(OBJDIR)" ]; then mkdir -p "$(OBJDIR)"; fi
       $(CXX) -c $(CXXFLAGS) $< -o $@

    $(RESULT): $(OBJS)
       $(CXX) $(CXXFLAGS) -shared -o $@ $(OBJS) $(LIBS)

    clean:
       rm -rf $(OBJDIR)
       rm $(RESULT)

Autodesk Softimage v7.5