Home

PVRShaman User Manual - Imagination Technologies

image

Contents

1. Figure 18 Add Material dialog Add a Material Using an Existing Effects File An existing effects file is a PFX file that contains pre written shader code The file may reference a number of textures in the form of PVR files These files must be present in the same folder as the PFX file In order to use an existing effects file 1 Click the radio button next to Use Existing Effects File and click Browse This will open an open file dialog box 2 Browse to the location of the PFX file and either double click it or single click it and click Open This will return the user to the Add Material window Figure 18 3 Click Accept to add the effects file to the scene it will now appear under Materials in the Scene Container the Visualization Panel will lose focus the Effects Editor will gain it and the shader code will now be visible Add a Material without an Effects File Itis possible to add a material without an effects file To do this click the radio button next to No Effect File and then click Accept The new material will now appear under Materials in the Scene Explorer window This material can be assigned to an object where it will retain its original colour but will now be affected by any lights within the scene Add a Single Texture as a Material To add a single texture without an effects file as a material 1 Click the radio button nextto No Effect File 2 Click Browse This will open an
2. WORLD mat4 World matrix WORLDI mat4 World Inverse matrix WORLDIT mat3 World Inverse Transpose matrix VIEW mat4 View matrix VIEWI mat4 View Inverse matrix VIEWIT mat3 View Inverse Transpose matrix PROJECTION mat4 Projection matrix PROJECTIONI mat4 Projection Inverse matrix PROJECTIONIT mat3 Projection Inverse Transpose matrix WORLDVIEW mat4 World View matrix WORLDVIEWI mat4 World View Inverse matrix WORLDVIEWIT mat3 World View Inverse Transpose matrix WORLDVIEWPROJECTION mat4 World View Projection matrix WORLDVIEWPROJECTIONI mat4 World View Projection Inverse matrix PVRShaman 45 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Keyword Format description Public CQJ Imagination WORLDVIEWPROJECTIONIT mat3 World View Projection Inverse Transpose matrix UNPACKMATRIX mat4 Matrix used to scale and offset vertex positions if the data has been exported with an unpack matrix VIEWPROJECTION mat4 View Projection matrix VIEWPROJECTIONI mat4 View Projection Inverse matrix VIEWPROJECTIONIT mat3 View Projection Inverse Transpose matrix OBJECT mat4 Object matrix without any parent node transformations OBJECTI mat4 Object Inverse matrix without any par
3. Inputs Lena pvr Post Process Chain InputEffect GreyscaleEffect MixEffect Frame Buffer Output Figure 25 Post process effects example Outputting to the Framebuffer When a post process effect is selected from the PVRShaman GUI a dependency tree is built This tree is used to determine which renders must be run and in which order to correctly display the selected effect Once this effect has been run its output is displayed in the Visualization Panel It should be noted that the post process effects described in this section cannot be applied to a model unlike the effects described in Section 2 5 2 PVRShaman 35 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public QJ imagination 2 6 Render Modes These modes change the way meshes are rendered and effects are applied within the Visualization Panel 2 6 1 Effects This is the default mode displaying any PFX and texture effects that are applied to the meshes as illustrated in Figure 26 2 6 2 No Effects This mode shows the meshes without the effects applied as illustrated in Figure 27 If no material is applied to a mesh or the material fails to load the mesh will be displayed in this way Figure 27 No Effects render mode Revision PowerVR SDK REL_3 5 3523383a 36 User Manual Co imagination Public Imagination Technologies 2 6 3 Wireframe This mode portrayed in Figure 28
4. WRAP_T WRAP_S These two options indicate which wrap mode is to be used for the texture Two valid values exist either REPEAT Or CLAMP VIEW CAMERA Used when performing a render to texture These tags indicate which camera should be rendered to this texture Valid values are PFX_CURRENTVIEW the currently selected view in PVRShaman or the name of any camera from the POD file When no values are provided the following values will be used e MINIFICATION N EAREST e MAGNIFICATION NEAREST e MIPMAP NONE e WRAP T WRAP S Revision PowerVR SDK REL_3 5 3523383a 28 User Manual QF imagination Public Imagination Technologies TARGET TARGET NAME Mix SURFACETYPE RGB888 RESOLUTION a12 512 MINIFICATION LINEAR MAGNIFICATION LINEAR TARGET The target block contains information about a render target displayed in full in Table 6 The target s name is used in an effects block to signify that the effect associated with that block should render to the named off screen buffer Table 6 Target block keywords NAME The name of the target for use in the effect block SURFACETYPE The pixel format of the target RGBA 8888 See following formats are RGBA 4444 RGB 888 RGB 565 RESOLUTION This specifies the resolution of the target buffer in the form lt x SIZE gt lt Y SIZE gt whe
5. This list is also available in Appendix B Submit Feedback To provide feedback click Help gt Feedback This will open a dialog box where instructions are displayed on how to post feedback and request for support Check for Updates As of SDK release 3 0 PVRShaman is able to auto update However to force check for software updates click Help gt Check for Updates About PVRShaman To view basic information about PVRShaman release information such as versioning and contact details click Help gt About 2 3 Working with a Scene 2 3 1 Visualizing a Scene The Visualization Panel is the area that displays the output of the combined scene data and materials as well as any meshes in the scene with the corresponding materials applied Figure 14 Lights and cameras are also displayed lights as a small light bulb and cameras as a small green camera In instances where an object is drawn without a material it will appear entirely grey This can be due to an error in the material that is applied or due to a lack of an applied material More information on the cause is revealed in the Task List window PVRShaman 17 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Qg Imagination Scene Editor RS R p No Camera y bi O o Forward sl Clicking an object in the scene selects it When an object is selected right clicking will bring up a contextual menu Finally scenes can b
6. B 1 AMS iia 45 B 2 Brel elt EE 45 Revision PowerVR SDK REL_3 5 3523383a 2 User Manual QF imagination Public Imagination Technologies Appendix C Regular Expression SyMtax ssccsscccesseesseeseseeeeneeeeesseeescaesesneeenseeesenesessaesnseeeneeaes 48 List of Figures SIICHT lu ue UE H Figure 2 ElTects Editor Panel n dd 8 Figure 3 Task List ll e 8 Figure 4 FING MEM di da 9 Figure b POD Info dialog DEE 10 Figure 6 Edit Scene men 11 Figure 7 Edit Shader men 13 Figure 8 Find and Replace dialog coooooconnnccccononccccnnonccnnnnonecnnnnnnocnnnnnnn cnn nnnncc nn nnnnn cnn rre cnn rnnnennnnnnnes 14 Figure 9 Buld Memi ici iiei E aaia NE A EEA ENE 14 Figure 10 Render meng como tre 15 FOUS 1s VON MENU uta ra E E E S 16 Fours 12 TOOIS mOn annaa E RAA RARE E 16 Figure 13 Help Mens ciia a A a a ta 17 Figure 14 Visualization Panel coccion edad ta 18 Figure 15 Scene Explorer Window oooooccconocccnnccccocnnononnnnno cnn cc narran nn 19 Figure 16 POD Explorer window cn cn rca 19 Figure 17 Object Data dialog ccoomcconnnnninncnnnncconnccnnnccnn nan nconccc nr 20 Figure 18 Add Material dialog ee 21 Figure 19 Creating a blank effects le 22 Figure 20 Light Properties Glo tutorials 24 Figure 21 Camera Properties dialog nana nn cnc cnn 25 Figure 22 Material Properties dialog ccceecccceceeececeeeeeceeeeeeeaeeeeeeaeeeeaeaaeeeseaaeeeseeeaeeeeeeeaeeesneeaeeeeneas 26 Figure 23 Per line cyc
7. is used for applying and rebuilding shaders Build Render View Tools Apply Shaders FS Rebuild Shaders Figure 9 Build menu Apply Shaders Apply Shaders compiles all shaders in the current POD file that have been edited and applies them to the scene in the Visualization Panel This function can also be triggered via a shortcut on the toolbar Rebuild Shaders Rebuild Shaders rebuilds all shaders in the current POD file irrespective of whether that shader has been edited Revision Power VR SDK REL_3 5 3523383a 14 User Manual QF imagination Public Imagination Technologies 2 2 5 Render Menu The Render menu Figure 10 is used when dealing with the meshes of objects in a scene View Tools Help Effects No Effects Wireframe Wireframe No Effects Depth Complexity Default Lighting Show Grid Show Axis Helper ES e el Depth Test Anti Alias O Backface Culling Frontface Culling Disable Culling Figure 10 Render menu Render Modes The first five options in the Render menu represent the available render modes Effects e Wireframe Wireframe No Effects e No Effects e Depth Complexity More details on these render modes can be found in Section 2 6 of this manual Toggle Default Lighting on and off Default Lighting toggles the default light on or off When it is turned off only lights from the POD file are used Show or Hide Grid Show Grid displays a grid around the origin wit
8. shows the effects applied to a wireframe version of the mesh 2 6 4 Wireframe No Effects This mode shows the wireframe mesh without any effects applied as per Figure 29 PVRShaman 37 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public QJ imagination 2 6 5 Depth Complexity This mode shows the depth complexity of the scene The brighter white means greater complexity as shown in Figure 30 Figure 30 Depth Complexity render mode 2 7 Texture Viewer The Texture Viewer displays a given texture within PVRShaman It can be accessed by right clicking a texture from within bottom portion of the Scene Explorer window The Texture Viewer can also show render to texture targets in real time as they update by double clicking the render to texture gt RI Texture Viewer Lorikeet 256x256 png 256x256 be Sa Zoom Level 100 y Figure 31 Texture Viewer dialog Using the Texture Viewer dialog it is also possible to save a texture to a file either as a pre loaded texture or a given frame of a render to texture target In addition it is possible to reload a pre loaded texture and zoom in or out on any texture Revision PowerVR SDK REL_3 5 3523383a 38 User Manual CJ Imagination 3 Preferences 3 1 General Public Imagination Technologies The Preferences dialog box is accessed by clicking Tools gt Preferences from
9. 4 PVRShaman 27 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Table 4 Shader block keywords Keyword Explanation NAME The name for the vertex shader for use in the effect block FILE The FILE tag can be used to specify a file that contains the vertex shader in cases where the GLSL code block is not used GLSL_ CODE Code within the GLSL code block is passed verbatim to the GLSL compiler and represents the actual shader code to be run TEXTURE TEXTURE NAME Lena PATH LenaPVR MINIFICATION LINEAR MAGNIFICATION LINEAR MIPMAP NEAREST WRAP T REPEAT WRAP S CLAMP TEXTURE The texture block contains information about a texture to be loaded and the flags to be used when drawing it listed in Table 5 Table 5 Texture block keywords Keyword Explanation NAME The name of the texture for use in the effect block PATH The path to the file the texture block represents Currently this file must be in the same folder as the PFX file MINIFICATION This option states how to handle texture minification Two valid values exist either LINEAR or NEAREST MAGNIFICATION This option states how to handle texture magnification two valid values exist either LINEAR or NEAREST MIPMAP This option states how to pick the correct MIP map Three valid values exist either LINEAR NONE or NEAREST
10. C lmagination PowerVR GraphicsSDK PVRShaman Example POD OGLES2 cubemap pyr History ik Figure 5 POD Info dialog Create a New Shader File The New Shader menu contains a list of shader types which when selected create a new file of the chosen type Open a Shader File Open Shader opens an existing shader file This can also be achieved by clicking the Open icon in the Shader Editor toolbar Save Shader Files Save Shader saves the currently selected shader whereas Save All Shaders saves all the currently open shaders The Shader Editor toolbar features a shortcut for the Save Shader action Revision PowerVR SDK REL_3 5 3523383a 10 User Manual an Imagination Public Imagination Technologies Close Shader Files Close Shader closes the currently selected shader whilst Close All Shaders closes all open shader files Shader files can also be closed via the Shader Editor toolbar Exit the GUI Quit closes PVRShaman 2 2 2 Edit Scene Menu The Edit Scene menu Figure 6 is used when altering the appearance of the scene being displayed in the Visualization Panel Edit Shader Build Render Fit Selected Fit All Centre Selected Hide All Unhide All Current View Properties Add Material Ctrl M Assign Material Delete Material Background Colour Save Screenshot F11 Select Q Pan W O Rotate E Zoom R Rotate Around Selected Play Pause P Figure 6 Edit Scene men
11. PFX or Microsoft Effect FX format while geometry is handled in the PowerVR Object Data POD format a file format created using the Collada2POD or PVRGeoPOD file exporters also available from the PowerVR Graphics SDK installer 1 2 1 Features PVRShaman has a variety of notable features e Windows Linux and OS X support e Geometry input from POD files generated using PVRGeoPOD e Support for PFX e Texture input from PVR files generated using PVRTexTool e Support for all common texture formats e Integrated version of PVRShaderEditor e POD viewer e WYSIWYG concept allows rapid prototyping of new shaders 1 2 2 Limitations Due to ongoing development the current edition of PVRShaman has the following limitations e Cannot open multiple POD files simultaneously e Cannot merge POD files e Does not allow for extra lights cameras or objects to be added to a POD only materials e The default shader i e the shader applied to objects when no shader has been set by the user only supports one light For more lights the user must use a shader that supports multiple lights PVRShaman 5 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination 1 2 3 File Types Through the course of this document several file types are mentioned The most important of these are listed in Table 1 Table 1 File types File type Description PFX PFX is a file format for storing and setting up shaders and ef
12. Shaders button in the toolbar or in the Build menu by clicking Rebuild Shaders or by pressing the F5 key 2 4 4 Profile Output Panel The Profile Output Panel is a section of the Compiler Output window and contains more detailed and accurate profiling information for the shader currently selected from the dropdown menu as shown in Figure 24 This information is gained by running the shader through a cycle accurate emulator The information displayed in the Profile Output Panel is explained further in Table 8 Per Line Cyde Estimate Total 80 Emulated Cyde Total 80 Shader VertShader Z Compiler 56X540 rev 130 Version 1 902650911 Emulated Cydes 56 Temporary Registers Used 3 Primary Attributes Used 7 Non Dependent Texture Loads 0 Global USC Instructions 9 Figure 24 Profile Output Panel PVRShaman 31 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public CQJ Imagination Table 8 Profile Output Panel Keyword Explanation Compiler This value identifies the graphics core name targeted by the compiler Version This value shows the compiler version string where available Emulated Cycles Best This number represents the number of cycles the shader will use when all conditional branches fail and are not processed Emulation gives a much more accurate measuring of cycles than the per line cycle count Emulated Cycles Worst This number represents the number
13. around the selected object rather than around the origin of the POD scene Play and Pause Animation Play Pause is used to control the animation currently playing inthe Visualization Panel These functions are also available on the panel toolbar Revision PowerVR SDK REL_3 5 3523383a 12 User Manual og Imagination Public Imagination Technologies 2 2 3 Edit Shader Menu The Edit Shader menu Figure 7 is used to modify any open shader files Edit Shader Build Render View Tools Undo Ctrl Z Redo Cut Ctrl X Copy Ctrl C Paste Ctrl V Delete Del Select All Ctrl A Find Ctrl F Replace Ctrl H Comment Selection Ctrl K Uncomment Selection Ctrl U Increase Indent Tab Decrease Indent Shift Tab Figure 7 Edit Shader menu Undo an Action Undo undoes the last performed action Redo an Action The last performed action can be redone by selecting Redo You can also select this function via the Shader Editor toolbar Cut Text Cut cuts the selected text to the clipboard Paste Text To retrieve the text from the clipboard select Paste Delete Text If it is simply required to delete the currently selected text click Delete Select All Text Select A11 selects the entire contents of the file that currently has focus Find and Replace Text Find Or Replace opens the Find Replace dialog Figure 8 It can also be accessed via the Effects Editor toolbar or by pressing Ctr1 F to find or Ctr1 H to replace Only
14. open file dialog box 3 Browse to the location of the texture file then either double click it or single click it and click Open PVRShaman 21 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination 4 Click Accept Note The POD file format does not store the full file path to texture files In order to avoid errors textures should be stored in the same folder as the POD file that uses them A warning will appear when using this option on a built in object or if the texture is not in the same folder as the POD file that is being edited or created Add a Material with a Blank Effects File A blank effects file is a PFX file with some basic formatting information to help write shaders as shown in Figure 19 Scene Editor xb SB oO xP MyNewEffectsrile pfx EJ 1 HEADER 2 HEADER 3 4 TEXTURES 5 TEXTURES 6 7 VERTEXSHADER 8 NAME 9 GLSL_CODE 10 GLSL_ CODE all VERTEXSHADER 12 13 FRAGMENTSHADER 14 NAME 15 GLSL_CODE 16 GLSL_CODE 17 FRAGMENTSHADER 18 19 EFFECT 20 NAME 21 VERTEXSHADER 22 FRAGMENTSHADER 23 EFFECT Figure 19 Creating a blank effects file In order to add a material with a blank effects file Select Add New Material Click the radio button next to Create Empty Effect File Click Browse This will open a save file dialog box Using this dialog box browse to a suitable location enter a name for the file c
15. the relevant sections of the toolbar will be displayed and any visible sections will appear below the toolbar PVRShaman 13 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination E g Find Finds Replace With Previous Options Method Match whole word Textual Replace Match case Regular Expression Replace A Wrap around Figure 8 Find and Replace dialog When ticking the Advanced box and set Method to be Regular Expression the find bar will interpret the search term as a regular expression The Find field will be shown in red if the search term is not a complete regular expression Information on what regular expressions are supported can be found in Appendix C Back references 11 to 19 can also be used in the Replace With field as well as the Fina field Comment on Selected Text Comment Selection comments out the selected text from the file If a complete line is selected that line will begin with If part of a line is selected that part will be surrounded in 7 Uncomment Selected Text Uncomment Selection removes the commenting out from the selected text either removing a surrounding orthe at the beginning of the line Increase Text Indent Increase Indent indents the selected text by a single tab Decrease Text Indent Decrease Indent removes an indent from the selected text 2 2 4 Build Menu The Build menu Figure 9
16. vertex shaders can be specified within a single PFX file ANNOTATION All text within the annotation sub block will be read into a string This string is not used in PVRShaman although it can be used to pass information to other applications that may later read the PFX file 2 4 2 Semantics In order for a shader to function its parent application must pass certain values to it namely uniforms and attributes A uniform is a value that is read only and does not change during a render for example light position or colour Attributes are input values that are different for every vertex they are also read only and are only available in the vertex shader Many of these values will change from shader to shader and will represent radically different things An example might be that one shader requires only the ModelViewProjection matrix whereas another might need the inverse transpose of the Mode1View matrix Given this wide area of requirement PVRShaman must have a means to understand what a given uniform or attribute represents so that the value can be provided to the shader when executing This is the purpose of the PVRShaman semantics a full list of which can be found in Appendix B 2 4 3 PVRShaderEditor PVRShaderEditor is the PowerVR shader and kernel editor available as both a standalone application and as a built in component of PVRShaman PVRShaderEditor features the following e Syntax highlighting e On the
17. 9 0 240302 0 257524 0 935915 0 992115 1 89462e 08 0 125333 3 1995e 08 0 704506 0 709698 0 968583 1 76975e 08 0 24869 n neeaaea 0 TNASNK n 70a1n2 n aaania 0 0314255 nn311957_ Lvs 1x 1275 Bone Indices none 1275 x 2 Float 0 958333 0 pl 0 1 0 02 0 916667 0 0 958333 0 02 H 1 0 04 i 0 916667 0 02 Data length 0 0 958333 0 04 n e75 n E Vertex Colours none Bone Weights none d Figure 17 Object Data dialog 2 3 3 Adding Materials to a Scene When working on scene it may become necessary to add a new material to change the scene s appearance Materials are added to a scene in the same way regardless of whether the scene has been imported from another program or is based on a built in object To add a material to PVRShaman 1 Click Edit Scene gt Add Material press Ctr1 M on the keyboard or select the shortcut on the main toolbar 2 This will open the Add Material dialog box as illustrated in Figure 18 3 Give the material a name relevant to what it does e g ParallaxBumpMap This name will be used to attach the material to objects within the scene Revision PowerVR SDK REL_3 5 3523383a 20 User Manual QF imagination Public Imagination Technologies FE RH Add Material Name NewMaterial1 Assign to Mesh None mi Use Existing Effect File Browse No Effect File Texture filename optional Create Empty Effect File From Effect Library Library
18. Edit Scene EditShader Build Open POD Ctrl 0 Open Recent POD Open Recent Export Open Built in Object Save POD Ctrl S Save POD As Close POD Reload POD Ctrl R POD Info New Shader Open Shader Save Shader Save All Shaders Close Shader Ctrl W Close All Shaders Quit Ctrl Q Figure 4 File menu Open a POD File Open POD opens a window displaying the location of saved POD files through which it is possible to select a particular file to open It is also possible to open files through the toolbar shortcut Open a Recent POD File To continue working on a recently opened POD selecting Open Recent POD will display a list of the ten most recently opened files to choose from Selecting Open Recent Export will display a list of the ten most recently exported files Clear Recent Files To clear the list of the ten most recently opened files select Clear recent files from the relevant option either Open Recent POD Or Open Recent Export Open a Built in Object Open Built in Object creates a new POD file from the existing object library Save a POD File Save POD saves the currently open POD file The main toolbar also has a shortcut for this function H it is required to save the currently open POD file to a new file select Save POD As and type in a new name for the file PVRShaman 9 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public On imagination Close a P
19. Error colour Warning colour Figure 34 Compiler Settings tab The options in the Compiler Settings tab are explained in Table 11 Table 11 Compiler Settings options Option Explanation Compiler path Compiler path shows the path to the compiler currently in use Location for This option specifies the directory the profiling information for shader will be temporary files output to for PVRShaderEditor to read Colour compiler With this option ticked the colouration of compiler warnings and errors can output be adjusted Error colour This button opens a colour selection window The selected colour is used during the debugging of effects that contribute to errors Warning colour This button opens a colour selection window The selected colour is used during the debugging of effects that contribute to warnings PVRShaman 41 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public QJ Imagination 3 4 Editor Settings The Editor Settings tab allows for the changing of settings relating to the editor Figure 35 E a Preferences General Viewport Compiler Settings Editor Settings Editor Colours Tab Tab size 4 Treat tabs as spaces Cursor Matching V Enable cursor matching Background colour ICH Find Results V Highlight find results Background colour ICH Figure 35 Editor Settings tab The options i
20. HADER FRAGMENTSHADER EFFECT Lena LenaPVR LINEAR LINEAR NEAREST nputEffectOutput RGB888 SH S12 LINEAR LINEAR GreyscaleEffectOutput RGB888 SL Bil LINEAR LINEAR MixEffectOutput RGB888 S2 Bil LINEAR LINEAR InputEffect inVertex POSITION inTexCoord UVO slexture TEXTUREO 0 Lena COLORO InputEffectOutput ScreenAlignedvs InputFS GreyscaleEffect inVertex POSITION inTexCoord UVO sTexture TEXTUREO 0 InputEffectOutput COLORO GreyscaleEffectOutput ScreenAlignedvs GreyScaleFS MixEffect inVertex POSITION inTexCoord UVO sOriginal TEXTUREO sGreyscale TEXTURE1 0 InputEffectOutput il GreyscaleEffectOutput COLORO MixEffectOutput ScreenAlignedvs MixFS Revision PowerVR SDK REL_3 5 3523383a 34 EXTUR E flag An User Manual og Imagination Public Imagination Technologies Step by Step Explanation Assuming that MixEf fect has been selected the following steps will occur as illustrated in Figure 25 1 Lena pur a texture file is used as an input for the InputEffect block 2 The InputEffect block is run outputting to InputEffectOutput 3 InputEffectOutput is used as an input for the GreyscaleEffect block 4 The GreyscaleEffect block is run outputting to GreyscaleEffectOutput 5 InputEffectOutput and GreyscaleEffectOutput are used as inputs for the MixEffect block 6 The MixEffect block is run rendering to MixEffectOutput
21. IFICATION LINEAR MAGNIFICATION LINEAR MIPMAP NONE VIEW Camera02 TEXTURE EFFECT NAME RenderToTextureEffect ATTRIBUTE inVertex POSITION ATTRIBUTE inTexCoord UVO UNIFORM sTexture TEXTUREO TEXTURE 0 renderTest VERTEXSHADER VertShader FRAGMENTSHADER FragShader EFFECT VERTEXSHADER NAME VertShader FILE VertShader vsh VERTEXSHADER FRAGMENTSHADER NAME FragShader FILE FragShader fsh FRAGMENT SHADER PVRShaman 33 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies 2 5 3 Public Post Process Effects COJ Imagination Post process effects are created by chaining multiple effect blocks together Using the output of one effect block set using the TARGET flag as an input to the next set using the T example of this with an explanation of each stage can be found below TEXTURE NAME PATH MINIFICATION MAGNIFICATION MIPMAP TEXTURE TARGET NAME SURFACETY PE RESOLUTION MINIFICATION MAGNIFICATION TARGET TARGET NAME SURFACETYPE RESOLUTION MINIFICATION MAGNIFICATION TARGET TARGET NAME SURFACETYPE RESOLUTION MINIFICATION MAGNIFICATION TARGET EFFECT NAME ATTRIBUTE ATTRIBUTE UNIFORM TEXTURE TARGET VERTEXSHADER FRAGMENTSHADER EFFECT EFFECT NAME ATTRIBUTE ATTRIBUTE UNIFORM TEXTURE TARGET VERTEXSHADER FRAGMENTSHADER EFFECT EFFECT NAME ATTRIBUTE ATTRIBUTE UNIFORM UNIFORM TEXTURE TEXTURE TARGET VERTEXS
22. OD File Close POD closes the currently open POD file which can also be achieved by clicking the shortcut on the toolbar Reload a POD File It is possible to reload the currently opened POD file by either selecting Reload POD from the menu or through the toolbar This is particularly useful if the file has been updated from an external application for example Autodesk 3ds Max Display POD File Information POD Info displays information as to the contents of the currently loaded POD file as shown in Figure 5 The total combined information about the file is displayed at the top with per mesh information at the bottom including what information was exported by Collada2POD or PVRGeoPOD The history section can also be used to keep track of changes made to the file Le SE H POD Info ES Nodes Materials Animation Geometry Meshes 2 Materials using effect files 1 Frames 101 Total Vertices 2550 Instanced Meshes 1 Total Materials 1 Animated Camera 0 Total Faces 4800 Cameras 0 Objects without materials O Animated Lights O Coordinate System OpenGL Lights O Interleaved Yes Helper Nodes 0 Total Nodes 2 Summary Vertices Faces Stride Padding Primitive Bone Batches Indexed UVs Normals Tangents Binormals Vtx Colours 1 1275 2400 56 0 Triangle List 0 Yes 8 Yes Yes Yes No Torus02 1275 2400 56 0 Triangle List 0 Yes 1 Yes Yes Yes No Resources C Imagination PowerVR GraphicsSDK PVRShaman Example POD OGLES2 ripple pfx
23. Q xe iridescence pfx EJ reflection pfx i HEADER 2 VERSION 02 00 00 00 3 DESCRIPTION Iridescence Example d 4 COPYRIGHT Imagination Technologies Ltd EI HEADER 6 2 TEXTURE 8 NAME thickness 9 PATH Thickness pvr 10 MINIFICATION LINEAR 11 MAGNIFICATION LINEAR 12 MIPMAP NONE 13 TEXTURE 14 15 VERTEXSHADER 16 NAME MyVertexShader 17 18 GLSL_CODE 19 attribute highp vec4 inVertex 20 attribute highp vec3 inNormal 21 attribute highp vec2 inTexCoord 22 23 uniform highp mat4 MVPMatrix y Figure 2 Effects Editor panel 2 1 2 Task List The Task List window used as a debug output panel Figure 1d contains information as to the state of the loaded effects and meshes as displayed in Figure 3 In the case of errors in shaders or effects files the line number and a description of the error will be seen Warnings are also given for errors which are non fatal and should not affect the running of the shader or effect in which the error occurs Task List pex Description File Line Loading Effects D Material Ripple using effect file C Imagination PowerVR GraphicsSDK PVRShaman Example POD OGLE C OGLES2 ripple pfx Figure 3 Task List window Revision PowerVR SDK REL_3 5 3523383a 8 User Manual QF imagination Public Imagination Technologies 2 2 Menu Bar 2 2 1 File Menu The File menu Figure 4 is used for saving or opening files used by PVRShaman
24. bring up options detailed further in Section 2 3 4 POD Explorer px 30 Lights QM Cameras 4 5 Materials 4 Ripple ripple pfx Effect Blending Disabled 4 Q Meshes 4 Mesh0 SS Vertices 1275 35 Faces 2400 Mech M Dependency Chain Figure 16 POD Explorer window PVRShaman 19 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination There are two types of materials A single textured material which can either be exported with a scene from Autodesk 3ds Max or Maya or setup as described in the Add a Single Texture section and a shader material composed of a single PFX file Double clicking a PFX file will bring up the integrated PVRShaderEditor interface Expanding the PFX item will show any external GLSL or texture files used within the PFX Double clicking a GLSL file will open it in the integrated editor Double clicking a texture file will open it in PVRTexTool if its location has been setin Tools gt Preferences gt Path to PVRTexTool orinthe Texture Viewer if it has not On the other hand Dependency Chain displays an ordered list of the render dependencies of the currently selected post process effect View Object Data The Object Data dialog Figure 17 displays all of the data associated with a particular mesh including vertex positions normal directions bone indices vertex colours etc It can be accessed by right clicking an object in the top portio
25. ce and angle from the centre of the light respectively Changes will be displayed as they are made and saving the POD file will store the changes Revision PowerVR SDK REL_3 5 3523383a 24 User Manual Sy Imagination Public Imagination Technologies Modify Camera Properties The Camera Properties dialog Figure 21 can be accessed by double clicking a camera in the Scene Explorer window a a Camera Properties l Camera Name Camera Name camerali Parameters FOV 0 66059 Far 10000 00000 Near 1 00000 From X 400 11301 Y 463 26401 Z 431 07800 To X 399 57654 Y 462 64285 Z 430 50671 Up X 0 42520 Y 0 78369 Z 0 45280 can Figure 21 Camera Properties dialog This dialog features several options namely Parameters FOV refers to the field of view Near and Far are the distances of the view frustum clip planes From From is the coordinate of the camera e To To is the coordinate of the point the camera is looking towards e Up Up refers to the direction of the up axis As with previous dialogs changes are displayed as they are made PVRShaman 25 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Modify Material Properties The Material Properties dialog Figure 22 displays a material s properties and allows them to be edited The dialog can be accessed by double clicking a material in the Scene Explorer window The effects file associate
26. d with a given material can be changed as can the specific effect being used Values for opacity shininess ambient colour diffuse colour and specular colour can be adjusted in the range 0 to 1 Clicking a colour panel brings up a Colour Selector dialog which serves as an alternative way to select the colour Blend mode data can also be changed at a very precise level All changes to the material are applied to the scene as the values are set E g Material Properties Ripple axe Material Colour Blend Operation Blend Colour Textures Material Name Ripple Effect File Use Effect File Effect File ripple pfx Browse Effect Name Effect y No Effect File Texture Browse Figure 22 Material Properties dialog Revision PowerVR SDK REL_3 5 3523383a 26 User Manual eJ Imagination Public Imagination Technologies 2 4 Building an Effect The PowerVR Effects PFX format is a small simple easy to use effects file format that allows for the declaration of application data semantics so that shaders can be accurately simulated A single PFX file consists of several blocks that describe how a given effect is put together see Section 2 4 1 and by default consists of a single effect Multiple effects may exist within a single PFX file each with their own effect block Likewise multiple shaders may exist within a single PFX each referenced by name It is also possible for separat
27. e PFX files to reference the same shaders by placing those shaders in separate files and linking to them from the vertex shader and fragment shader blocks The full specification for the PFX format is included in the PVRShaman package and is also accessible from the PowerVR Insider website 2 4 1 PFX Blocks Each PFX file is broken down into several blocks with each block serving a different purpose A basic effect consists of a header an effect block a vertex shader block a fragment shader block and one or more texture and or target blocks HEADER HEADER VERSION Da 00 000 0 0 DESCRIPTION header example COPYRIGHT Imagination Technologies HEADER The header block contains information about the PFX file being edited as explained in Table 3 Table 3 PFX header keywords VERSION The version of the PowerVR Effects file specification that the file uses DESCRIPTION A description of what the effect does COPYRIGHT A copyright string VERTEXSHADER FRAGMENTSHADER FRAGMENTSHADER NAME FragShader GLSL CODE uniform sampler2D sampler2d varying highp vec2 texCoordinateMain void main void gl_FragColor texture2D sampler2d texCoordinateMain GLSL_CODE FRAGMENTSHADER VERTEXSHADER NAME VertShader FILE VertShader vsh VERTEXSHADER The vertex shader block describes a given vertex shader It contains up to two keywords and one nested block listed in Table
28. e explored using the mouse and keyboard Camera Selection The Visualization Panel toolbar features a pull down menu that permits the selection of the current camera for the viewport No Camera means that the current view is not from a camera defined in the scene Follow Selected follows the currently selected object which is useful for observing one object through an animated scene Scene Progress The progress bar in the toolbar shows the progress through the current scene The box next to it shows the Current Frame section of the Toolbar The number entered in here represents the frame currently being displayed Time Direction Another dropdown menu is available in the toolbar with which the direction of time within an animated scene can be selected The three options are e Forward The standard direction of the scene e Reverse The reverse of the direction indicated by Forward e Ping Pong The scene will play Forward until completion and then will play Reverse until the first frame is returned to 2 3 2 Exploring a Scene View Objects in a Scene Objects in a scene are displayed in the Scene Explorer window Figure 15 This also shows object meshes as well as any material applied to them If a mesh has a parent this will be reflected in the tree structure An object can be selected with a single click highlighting the model while double clicking the object name will centre the model in the Visualization Panel Revisio
29. eJ Imagination Public Imagination Technologies PowerVR by Imagination PVRShaman User Manual Copyright O Imagination Technologies Limited All Rights Reserved Appendix A This publication contains proprietary information which is subject to change without notice and is supplied as is without warranty of any kind Imagination Technologies and the Imagination Technologies logo are trademarks or registered trademarks of Imagination Technologies Limited All other logos products trademarks and registered trademarks are the property of their respective owners Filename PVRShaman User Manual Version PowerVR SDK REL_3 5 3523383a External Issue Issue Date 17 Apr 2015 Author Imagination Technologies Limited PVRShaman 1 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Contents Te ite e e EE 5 1 1 Document OVerVieW cccccconocccccccncnnononononcnncnnnnnnnnncnnnnn nono nn unun EEEE canon nana an anna nn nn nn nana nan n acc nnninas 5 1 2 Software Ovetvlew 5 1 2 1 Feature S aaa a a la a 5 1 2 2 Bin EH E 5 2 3 Elle TY POS mcr dd ad 6 1 3 Installato Te DEE 6 1 3 1 Installing from Installer A 6 1 3 2 Compatibilidad idad 6 1 3 3 Optional Requirement nan nc cnn nan nn rana cnn ran ranas 6 2 PVRShaman GU ais 7 2 1 User Interface Layout urticaria 7 2 1 1 Effects Edito ANOP 0O0 0Ow UXUDPOPP deuaneeekathedieveatadiuusecdwebetets 7 2 1 2 Taste td 8 2 2 Men Ball wtcdiscn
30. ent node transformations OBJECTIT mat3 Object Inverse Transpose matrix without any parent node transformations MATERIALOPACITY float Opacity of material MATERIALSHININESS float Shininess of material MATERIALCOLORAMBIENT vec3 Ambient colour of material MATERIALCOLORDIFFUSE vec3 Diffuse colour of material MATERIALCOLORSPECULAR vec3 Specular colour of material BONECOUNT int Number of bones BONEMATRIXARRAY mat4 Array of bone transformation matrices BONEMATRIXARRAYIT mat4 Array of bone inverse transpose transformation matrices LIGHTCOLOR n vec3 Colour of light n RGB Example LIGHTCOLORS LIGHTPOSMODEL n vec3 Position of light n in model space Example LIGHTPOSMODEL1 LIGHTPOSWORLD n vec3 Position of light n in world space Example LIGHTPOSWORLD1 LIGHTPOSEYE n vec3 Position of light n in view space Example LIGHTPOSEYE1 LIGHTDIRMODEL n vec3 Direction of light n in model space Example LIGHTDIRMODEL1 LIGHTDIRWORLD n vec3 Direction of light n in world space Example LIGHTDIRWORLD1 LIGHTDIREYE n vec3 Direction of light n in view space Example LIGHTDIREYE1 LIGHTATTENUATION n vec3 Attenuation for spot lights constant linear quadratic LIGHTFALLOFF n vec2 Falloff for spot lights angle exponent EYEPOSMODEL vec3 Eye position in model space EYEPOSWORLD vec3 Eye position in world space TEXTURE n sampler2D Sampler for texture n Example TEXTURE2 ANIMATION float Contains
31. fects with runtime available in the PowerVR Graphics SDK tools and examples in the training course demos PFX files are editable in PVRShaman and PVRShaderEditor POD POD is a file format for storing complete scenes with meshes lights animations materials and references to textures and effects While PODs are not compressed they store information in a format designed for speedy deployment to hardware PVR PVR is a file format for storing API friendly textures PVR files are produced using PVRTexTool and can be compressed as small as 2 4 bits per pixel while still maintaining a good quality Collada DAE Collada is a royalty free XML file scheme developed by the Khronos group that acts as an interchange format for digital assets and effects Microsoft Effects FX Microsoft Effects is a proprietary file format belonging to the Microsoft Corporation used for setting up effects for use with the DirectX API 1 3 Installation In order to use PVRShaman as a shader development environment a graphics card that supports the targeted API is required e g if shaders are being written for DirectX10 a DirectX10 capable graphics card is required For viewing POD files an older card can be used 1 3 1 Installing from Installer Download the PowerVR Graphics SDK package and follow the on screen instructions Once the package is installed browse to lt InstallDir gt PVRShaman 1 3 2 Compatibility For PVRSha
32. fied Figure 33 e al Preferences General Viewport Compiler Settings Editor Settings Editor Colours Background colour D Primary grid colour TI Secondary grid colour Draw lights and cameras Y Figure 33 Viewport tab The options in the Viewport tab are further explained in Table 10 Table 10 Viewport options Option Explanation Background This option allows for the colour of the background in the Visualization colour Panel to be changed Primary grid This option allows for the primary colour of the grid in the Visualization colour Panel to be changed Secondary grid This option allows for the secondary colour of the grid in the colour Visualization Panel to be changed Draw lights and Draw lights and cameras sets whether lights and cameras have icons cameras displayed in the Visualization Panel Revision PowerVR SDK REL_3 5 3523383a 40 User Manual Sy Imagination Public Imagination Technologies 3 3 Compiler Settings The Compiler Settings tab allows the configuration of compiler paths Figure 34 FE a Preferences General Viewport Compiler Settings Editor Settings Editor Colours Compiler PowerVR Series5 y Compiler path Browse Location for temporary files CH Compiler Details Compiler 56X540 rev 130 Version 1 90 2650911 Language GLSL ES Supported options nowarn perfsim profile Compiler Output V Colour compiler output
33. fly cycle counts Register information Revision PowerVR SDK REL_3 5 3523383a 30 User Manual QF imagination Public Imagination Technologies By default the cycle count for the currently selected file the total of all available shaders as well as all paths through those shaders is under the Profile Output Panel ofthe Compiler Output window Cycle counts are also available on a per line basis allowing to quickly spot bottlenecks and see the effect of optimizations as they are carried out as displayed in Figure 23 Scene Editor xb BB Qi axe ripple pfx E 30 void main void 318 32 ao 16 float ripple 4 0 cos 0 1 inVertex z radians 1 0 Animation 360 0 S 11 float ripple2 1 0 cos 0 1 inVertex x radians 2 0 Animation 360 0 35 36 vec3 vertex vec3 0 37 38 if GeometryCounter 0 39 40 2 vertex inVertex vec3 ripple ripple2 ripple2 41 3 Color vec4 1 0 0 5 1 0 1 42 43 else 44 45 Color vec4 0 5 0 0 1 0 1 46 2 vertex inVertex vec3 ripple2 ripple ripple2 47 I 48 49 9 gl_Position WorldViewProj vec4 vertex 1 0 50 9 Normal normalize WorldViewIT inNormal aa 3 EyeDir vec3 gl_Position BP H y Figure 23 Per line cycle counts It should be noted that these cycle counts are only approximations and only available once a shader is capable of being compiled i e functional The cycle counts can be updated in one of several ways either by clicking the Apply
34. formation combined with diffuse and specular lighting calculations Cell Shading A type of non photorealistic rendering used to give a cartoon style effect Cell Shading Fog An implementation of linear exponential and exponential squared Cell Shading Fog Refraction A technique for mimicking the effect of light passing through a translucent surface like glass Bumpmap A technique to fake complex geometry through the manipulation of reflected light Fresnel A demonstration of reflections based on the incidence of the view vector Reflection taking into account the different refractive indices between two media Iridescence A shader which mimics the behaviour of light reflecting off a surface covered by a translucent film with variable thickness Cubemap A shader which reflects light hitting the model to a supplied cubemap which Reflection is treated as if it surrounds the model Note The POD file format does not store the full file path to texture files In order to avoid errors textures should be stored in the same folder as the POD file that uses them A warning will appear when using this option on a built in object or if the texture is not in the same folder as the POD file that is being edited or created Apply a Material Once a material has been added and appears in the Scene Container it can applied to a model This can either be done as part of creating the effect from the Add Mate
35. hin the Visualization Panel Show or Hide Axis Helper Show Axis Helper displays a small X Y Z axis diagram around the origin within the Visualization Panel Enable or Disable Depth Test Depth Test allows for the enabling or disabling of depth testing within the scene Activate or Deactivate Anti Aliasing Anti Alias activates or deactivates anti aliasing for the current scene Toggling this option requires the scene to be saved and reopened PVRShaman 15 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Enable or Disable Culling Backface Culling tells PVRShaman to enable or disable back face culling Frontface Culling enables or disables front face culling This allows scenes that have different winding orders for their polygons to be rendered correctly by PVRShaman Disable Culling disables all culling 2 2 6 View Menu The View menu Figure 11 is used to access various display panels in the GUI View Tools Help O Tabbed Floating Scene Floating Editor Task List Scene Explorer POD Explorer Compiler Output Figure 11 View menu Customize the GUI Layout The Visualization Panel andthe Effects Shader Editor are displayed as tabs by default By selecting either Floating Scene or Floating Editor that panel can be opened up as its own window for ease of viewing Ss Show or Hide the Task List Window Selecting the Task List option will display the relevant sec
36. le COUN Score cdas EE teen eee tie a a Ee 31 Figure 24 Profile Output Panel 31 Figure 25 Post process effects evample canon cnn nano n nn rca nn nr nan n nc rnnnnncnnnnns 35 Figure 26 Effects render mode serisini sa a E AEA name cnn nana caninas 36 Figure 27 No Effects render MOB ooooccconocccccnonoccccnonoccnnnononcnnnnnennnnnnno ENNA AARAA NRAN AEAN NANNA NAKERTAA rca E 36 Figure 28 Wireframe render MOB oooccccconocccccononcccnononcncnanoncncnnnoncnnnnnonnnn canon cnc nan nnn rra nn nr nan nn nr nan ncnnnnnns 37 Figure 29 Wireframe No Effects render mode AA 37 Figure 30 Depth Complexity render mode 38 Figure 31 Texture Viewer dialogi sessar annia aan oe ao 38 Figure 32 Gen ral taD EE 39 Figure 33 Viewport taD EE 40 Figure 34 Compiler Settings ob 41 Figure 35 Editor Settings tab iissa neika aaaea cnn cnn 42 Figure 36 Editor COlOurs Gab 43 List of Tables A e o EU OO ENEE E NAE aaraa vear 6 Table 2 Library EE 23 Table 3 PFX header keywordS oooomoccccnonccccononccccnnonecccnnnnecccnnnne cnn cnn 27 Table 4 Shader block Keywords oooonccconcccnoncccnoncoccccncancnnnnacnnnncnn arc 28 PVRShaman 3 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Table 5 Texture block keywords oooooconnccccnnonccccnnoncccnnnnnccnnnnnecc cnn cnn rre reee 28 Table 6 Target block Keywords soassa ea aE ENAS A 29 Table 7 Effect block keywords iii RA A deeg 30 Table 8 Profile Output Pel tocarla
37. lick Save Click Accept gi e o e Note The POD file format does not store the full file path to texture files In order to avoid errors textures should be stored in the same folder as the POD file that uses them A warning will appear when using this option on a built in object or if the texture is not in the same folder as the POD file that is being edited or created Existing Library Effects PVRShaman includes a small library of built in effects which can be automatically copied into a new PFX file as listed in Table 2 In order to make use of these examples 1 From the Add Material window click the From Effect Library radio button 2 From the library window select the desired effect and click Browse 3 A Save File dialog box will open Using this dialog box browse to a suitable location and enter a name for the file Revision PowerVR SDK REL_3 5 3523383a 22 User Manual CJ Imagination Public Imagination Technologies 4 Click Save and then click Accept Table 2 Library effects Effect Explanation Basic Lighting Basic lighting functionality Basic Texturing Basic texture functionality Anisotropic Lighting A form of lighting used to mimic satin surfaces or brushed metal Complex Lighting A shader for handling a number of standard lighting situations this shader is not designed to be optimal for performance Fast Transform and Lighting An efficient algorithm for basic trans
38. man to run efficiently it is recommended to install the utility on a machine running at least either Windows 7 OS X 10 6 Snow Leopard or Linux Ubuntu 12 04 1 3 3 Optional Requirements It is possible to plug PVRTexTool into PVRShaman allowing for images to be directly opened from the Scene Explorer by double clicking For this to work PVRTexTool must be installed and its location setin Path to PVRTexTool under Tools gt Preferences gt General Revision PowerVR SDK REL_3 5 3523383a 6 User Manual QF imagination Public Imagination Technologies 2 PVRShaman GUI 2 1 User Interface Layout The PVRShaman interface is composed of several panels which hold information about the current scene the materials within the scene and any debug output from those materials The information is presented as portrayed in Figure 1 H PVRShaman 2 3 toruspod OGLES2 il a PE File EditScene EditShader Build Render View Tools Help MMXCReD XN A Scene Explorer SS Scene Editor a EI Mech c b i Meh 0 B X Tasklist ax persine Cyde Estimate Total 62 Emulated Cyde Total 61 Description File Line Loading Effects T Material Ripple using effect file C Imagination PowerVR_Graphics PowerVR_Tools P _C OGLES2 ripple pfx Shader MyVertexShader SGX540 rev 130 1982650911 J 22 EE e Primary Attributes Used 10 Non it Texture Loads 0 Global USC Ins
39. me represents the name of the PVRShaman semantic list see Appendix B ATTRIBUTE Used multiple times to set up a given attribute in the shader This is written in the form ATTRIBUTE lt NAME gt lt SEMANTIC gt where the name represents the name of the attribute as it is written in the shader and the semantic represents a semantic from the PVRShaman semantic list see Appendix B TARGET Used multiple times This is used to set a target number and name for a given render to texture target represented by a TARGET block Itis declared in the form TARGET COLOR lt NUMBER gt lt NAME gt where number represents the ID of the target and the name represents the name of the texture as set inthe TARGET block Its purpose is to specify the render target to be used by an effect TEXTURE Used multiple times This is used to set a texture number and name for a given texture set by a texture block It is declared in the form TEXTURE lt NUMBER gt lt NAME gt where number represents the ID of the texture and name represents the name of the texture as set in the texture block FRAGMENTSHADER Used to specify the fragment shader to be used for this effect This is required as multiple fragment shaders can be specified within a single PFX file VERTEXSHADER Used to specify the vertex shader to be used for this effect This is required as multiple
40. n PowerVR SDK REL_3 5 3523383a 18 User Manual or imagination Public Imagination Technologies Scene Explorer ax 4 O Scene 4 o Torus01 Mesh0 Ripple 4 Torus02 Mesh1 D Ripple 0 Post Processing None Figure 15 Scene Explorer window Right clicking the model name will open a context menu with options to Show references i e the linkage between scene nodes and POD items Assign a material to the currently selected object Open the currently selected object in the View Object Data Fit the object to the screen Centre the object on the screen Hide the selected object Hide all other objects Unhide all objects There are no context menus on right click for lights or cameras However double clicking a camera will adjust the Visualization Panel to look through the associated camera The top portion of the Scene Explorer window also contains the post processing controls Right clicking the currently active effect will allow the selection of the post process if any exists that is currently rendered to the Visualisation Panel lf None is selected then no post processing is performed and the scene is rendered to the Visualization Panel as normal View Components of a Scene The POD Explorer window displays the stored components of the scene including materials effects files etc Figure 16 Expanding a component will display its properties and double clicking a property will
41. n of the Scene Explorer window and selecting Open Data Viewer This is particularly useful for spotting errors in models or in the exporting process m 7 H Object Data Torus01 27 R ess Vertices 1275 x 3 Float Tangents 1275 x 3 Float Indices 7200 x 1 UnsignedShort Strip Lengths none 3 8147e 06 4 10703 55 2456 2 0 0161998 0 966145 0 25749 jjo j 3 8147e 06 5 56548e 14 55 7863 2 15399e 11 1 3 42812e 10 1 6 99187 1 38764e 13 55 3464 3 68321e 10 1 3 50519e 09 2 3 8147e 06 7 93417 53 6603 0 0313007 0 866894 0 497509 3 6 9241 4 10703 54 81 0 0322763 0 966272 0 255493 0 13 8735 1 16193e 14 54 0337 1 50574e 09 1 4 6 72542 7 93417 53 2372 6 42051e 09 0 13 739 4 10703 53 5099 0 062385 0 867319 0 493822 2 3 8147e 06 11 2206 51 1386 0 0640436 0 966272 0 249433 4 E 4093A 11 2206 50 7353 T l a nasazen a 709002 n 703215 lla Normals 1275 x 3 Float Binormals 1275 x 3 Float 1 14434e 07 0 257524 0 966272 0 999869 0 0156535 0 00417173 3 7 69165e 08 3 42812e 10 2 1 2 15399e 11 0 125333 3 52372e 09 0 992115 7 69165e 08 ES values per batch 5 2055e 08 0 497753 0 867319 0 992115 7 39007e 11 0 125333 0 121106 0 257524 0 958653 0 99951 0 0271477 0 01558 one indices none Num bone indices none Triangle offset none 0 24869 6 59326e 09 0 968583 0 992115 2 17337e 09 0 125333 0 108704 0 497753 0 86048 0 968583 1 38277e 10 0 2486
42. n the Editor Settings tab are explained in Table 12 Table 12 Editor Settings options Option Explanation Tab size Tab Size sets the number of spaces a tab will use if the option Treat tabs as spaces is ticked Treat tabs as spaces If Treat Tabs as Spaces is ticked PVRShaderEditor will treat tab as a sequence of spaces Enable cursor With this option ticked all text in the Effects Editor matching the text matching under the cursor will be highlighted Background This button opens a colour selection window The selected colour is used in colour the Effects Editor for highlighting text selected by Enable Cursor Matching Highlight find results With this option ticked text that matches the contents of the Find toolbar is highlighted in the Effects Editor Background colour This button opens a colour selection window The selected colour is used in the Effects Editor for highlighting text selected by Highlight Find Results Revision PowerVR SDK REL_3 5 3523383a 42 User Manual CJ Imagination Public Imagination Technologies 3 5 Editor Colours The Editor Colours tab allows controlling the appearance of the Effects Editor and includes everything from background colour to syntax highlighting colours for the various supported languages Figure 36 IL al Preferences General Viewport Compiler Settings Editor Setti
43. ngs Editor Colours FontFace Courier New v FontSize 12 x Code Elements a SCH O 4 Plain Text lobal Background Colour Code Global Cursor Colour a PFX GLSL Font Colour wm GLSL ES ge dee HLSL Background Colour ILI Lues Global OpenCL Bold Underline Sample vecs sample mix a b 0 5 Defaults SZ Gn Figure 36 Editor Colours tab The options in the Editor Colours tab are detailed in Table 13 Table 13 Editor Colours options Option Explanation Font Face This drop down menu lists a selection of fonts available for use in the Effects Editor Font Size This drop down menu allows for the selection of the size of the font used in the Effects Editor Global Background Colour This option allows the colour of the background to be changed Global Cursor Colour This option allows the cursor colour to be changed Font Colour This option allows for the changing of the colour used in the text displayed in the Effects Editor Background Colour This option allows for the selection of the colour to be used as the background of the text Bold Ticking this box will make the text bold Underline Ticking this box will underline the text PVRShaman 43 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination 4 Contact Details For further support visit our forum http forum imgtec com Or file a ticket in our S
44. of cycles the shader will use when all conditional branches succeed and are processed In many cases the best and worst cycle counts will be identical Emulated Cycles This number represents the number of cycles the shader will us and is only displayed when there are no conditional blocks present Primary Attributes Used Primary Attributes are the number of logical input entities The number of registers consumed by a primary attribute will depend on the number of elements and on its precision For indication only input data storage typically has 1280 registers allocated varying from platform to platform These registers are shared by all the shaders being run at any one time Running out of registers will force reading and writing from external memory which might affect performance Temporary Registers Temporary Registers are the extra data storage required to process a shader As in the case of primary attributes overflowing the storage allocated might cause degradation in performance Temporary data storage typically has 384 registers allocated this number might vary depending on the platform Non Dependent Texture Loads Non Dependent Texture Loads represents the number of texture loads within the selected shader that can be pre fetched they are independent of the processing of the shader Global USC Global USC Instructions represents the number of instructions that Instructi
45. ons can be extracted and performed once per frame rather than once per use of the shader 2 5 Render to Texture and Post Process Effects 2 5 1 Overview The phrase render to texture is used to describe any scenario during the rendering of a scene where it is required that rendering be directed to another buffer other than the frame specifically to a texture Post processing refers to any full screen technique performed on a scene after the scene has been fully composited and rendered Instead of rendering 3D objects directly the scene is first rendered to a texture Pixel shaders are then used to apply filters to the texture before displaying it Post processing allows effects to be used that require awareness of the entire image such as high dynamic range bloom motion blur screen space ambient occlusion crepuscular rays film grain simulation depth of field and shadow mapping Revision PowerVR SDK REL_3 5 3523383a 32 User Manual QF imagination Public Imagination Technologies 2 5 2 Render to Texture Rendering to a texture is done in much the same way as rendering to the framebuffer Vertex shader fragment shader effect and texture blocks are created as usual with the exception that the texture is given a VIEW entry representing the name of the camera within the loaded POD file whose view is to be rendered into the texture An example of this can be seen below TEXTURE NAME renderTest RESOLUTION Sie wal MIN
46. ounding maximum for x y Z RANDOM float A random value Range 0 to 1 MOUSEPOSITION vec3 The mouse position on screen x y time LEFTMOUSEDOWN vec4 The left mouse down state and its position at that time x y isdown timedown RIGHTMOUSEDOWN vec4 The right mouse down state and its position at that time x y isdown timedown PVRShaman 47 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Appendix C Regular Expression Syntax Table 16 lists the regular expression syntax used by PVRShaman Table 16 Regular expression syntax and description COJ Imagination Special constructs 21 X Match sub pattern case insensitive I X Match sub pattern case sensitive n X Match sub pattern with newlines N X Match sub pattern with no newlines X Capturing parentheses use with back references X Non capturing parentheses X Zero width positive look ahead X Zero width negative look ahead lt X Zero width positive look behind lt X Zero width negative look behind gt X Atomic grouping possessive match Logical operators X Y X followed by Y X Y Either X or Y Quantifiers xX Match 0 or more Match 1 or more Match 0 or 1 Match 0 or more Match n times m Match no more than m times n Match n or more XIXI XM XM XKX X Se B n m Match at least n but no more
47. re size is a number of pixels MINIFICATION This option states how to handle texture minification Two valid values exist either LINEAR Or NEAREST MAGNIFICATION This option states how to handle texture magnification Two valid values exist either LINEAR Or NEAREST EFFECT EFFECT NAME Bumpmapping VERTEXSHADER VertShader FRAGMENTSHADER FragShader TEXTURE 0 base TARGET COLORO rendertarget ATTRIBUTE inVertex POSITION ATTRIBUTE inNormal NORMAL ATTRIBUTE inTexCoord UV ATTRIBUTE inTangent TANGENT UNIFORM MVPMatrix WORLDVIEWPROJECTION UNIFORM LightPosition LIGHTPOSMODELO UNIFORM sampler2D TEXTUREO EFFECT The effect block is used by PVRShaman to set up the shader It defines all the attributes and uniforms to be passed to the shader a name for the shader and the names of the vertex and fragment shaders that are to be used for this given effect all of which are listed in Table 7 It can also be used to set annotations and to set the texture number for a given texture Seven keywords and one nested block are available for use PVRShaman 29 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Table 7 Effect block keywords Keyword Explanation NAME The name for the overall effect UNIFORM Used multiple times to set up a given uniform in the shader This is written in the form UNIFORM lt NAME gt lt SEMANTIC gt where the na
48. rial window or by right clicking a model within the Scene Explorer window choosing Select Material and selecting the desired material There is also a shortcut for this function on the main toolbar 2 3 4 Modify Light Properties Modifying Properties The Light Properties dialog can be accessed by double clicking a light in the Scene Explorer window PVRShaman 23 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public On imagination Le RI Light Properties Light Name Light Name directionalLight1 Colour Red 1 00000 Green 1 00000 Blue 1 00000 Type Light Type Directional Zl Position X 0 00000 Y 0 00000 Z 0 00000 Direction Attributes Contant Attenuation 0 00000 Linear Attenuation 0 00000 Quadratic Attenuation 0 00000 Falloff Angle 0 00000 Falloff Exponent 0 00000 Conca Figure 20 Light Properties dialog It features several options namely Colour Colour values must be in the range 0 to 1 Type The type of light can be either Point Directional or Spot e Position Position refers to the coordinates of the light source disabled for directional lights Direction Direction refers to the direction of the light disabled for point lights e Falloff and Attenuation Falloff and Attenuation are for spot lights only and refer to the rate at which the light from a spot light falls off to zero based on distan
49. rol scheme of the Visualization Panel so that objects can be selected by clicking them This option can also be selected via the toolbar Pan This radio button changes the control scheme of the Visualization Panel so that it is possible to pan around the scene using the mouse while the left mouse button is down The control scheme can also be changed by clicking the relevant button in the toolbar It is also possible to hold the Shift key while middle clicking and dragging with the mouse in order to pan Rotate With Rotate active either through the menu or the toolbar it is possible to rotate the scene around the currently selected object the world axis or the centre of the Visualization Panel using the mouse while the left mouse button is down Rotation can also achieved by middle clicking and dragging with the mouse Zoom in and out With Zoom active mouse movement will control the zoom level of the Visualization Panel while the left mouse button is held down Pulling back will zoom out and pushing forwards will zoom in This function can also be activated from the toolbar The mouse wheel can also be used to zoom in and out FPS Navigation With this option selected the mouse and keyboard now allow for First Person Shooter FPS like movement Pressing the Esc key will exit this mode returning the control scheme to Select Rotate View around Selected Object When this option is ticked the Rotate button on the toolbar rotates
50. tcncsccunies stock ENEE SEE SEENEN 9 2 2 1 File Men dial 9 2 2 2 ST AAA II A E a 11 2 2 3 Edit Shader EE 13 2 2 4 BGG Men viii dad ias 14 2 2 5 Render Menu 15 2 2 6 View Melon did aida dci 16 2 2 7 MOOS MEN Zeg EE EE 16 2 2 8 elle 17 2 3 Working With a Scene oooonoccccncccconccononanononcnnnoccnnncn narran cnn ran 17 2 3 1 Visualizing a Scene sssseseeseseseeesersseestesristtinttntttnttnnttnntnntn netu neenneennsen usett enn 17 2 3 2 Exploring a Scene coccccconcccconccononanononcnonnccnnnc cnn nn nana 18 2 3 3 Adding Materials to a Scene ooooonnccinicccinccononinononnnnnoccnnrnn nn rca rra rn 20 2 3 4 Modifying PTOPertIES ccoo dead adidas 23 2 4 Building an TE 27 2 4 1 PEX BIOCKS oral alto dorada 27 2 4 2 AMAN EE 30 2 4 3 DVbGhadert dor 30 2 4 4 Profile Output Panel 31 2 5 Render to Texture and Post Process Eitece 32 2 5 1 OOO EE 32 2 5 2 Bender Lettre suste ege ee eii alitas 33 2 5 3 Post Process e CN 34 2 6 Render Modest alo 36 2 6 1 Edesa li do 36 2 6 2 No SEM OCIS oia colo 36 2 6 3 Ve AMES eiii 37 2 6 4 Wiretrame No Effects o ccocionoooioinn alicia dead 37 2 6 5 Depth Complex Vicio dt 38 2 7 Texture NIE deed 38 3 Preferences iii A dais 39 3 1 General e 39 3 2 VlOWPO icon 40 3 3 Compiler Settings scort ia oe 41 3 4 Selten EE 42 3 5 A 43 4 Contact Details iii aia 44 Appendix B PVRShaman PFX Semantics List cccssccssseeeeeeeeeeeeeeeeeseseeeenseeeseeesesnaeeeseeeenseees 45
51. than m times Boundary matching Note These quantifiers are greedy By following them with it becomes possible to turn them into lazy quantifiers or follow them with for possessive non backtracking quantifiers d Match begin of line if at begin of pattern Match end of line if at end of pattern lt Begin of word gt End of word b Word boundary B Word interior A Match only beginning of file Revision PowerVR SDK REL_3 5 3523383a 48 User Manual Ko Imagination Public Imagination Technologies Z Character classes Match only end of file abc Match a b orc abc Match any but a b orc a zA Z Match upper or lower case a through z Matches Matches Predefined character classes Match any character d Digit 0 9 D Non digit s Space NS Non space w Word character a zA Z_0 9 W Non word character l Letter a zA Z L Non letter h Hex digit 0 9a fA F NH Non hex digit Vu Single uppercase character NU Single lowercase character p Punctuation not including _ P Non punctuation Characters Back slash character 033 Octal x1b Hex t Tab n Newline Back references 1 to 9 Reference to 1 to 9 capturing group PVRShaman 49 Revision PowerVR SDK REL_3 5 3523383a
52. the menu bar The default window displays the general options available Figure 32 EE al Preferences Animation FPS API General Viewport Compiler Settings Editor Settings Editor Colours Compile shaders in background when possible v Close tabs with middle mouse button Path to PVRTexTool PVRTexTool GUI Windows_x86_32 PVRTexToolGUI exe Browse Override POD OpenGL 9 OpenGL ES 2 0 OpenGL ES 3 0 Figure 32 General tab The options in the General tab are listed in Table 9 Table 9 General options Option Explanation Compile shaders in background when possible With this option ticked PVRShaderEditor will attempt to compiler shaders in the background allowing it to display per line cycle counts and profiling output while the user types Close tabs with middle mouse With this option ticked middle clicking a tab in the tab bar will close the tab button Path to Path to PVRTexTool sets the path to the PVRTexTool binary If this is PVRTexTool set double clicking a texture will open it in PVRTexTool Animation FPS Animation FPS overrides the frames per second FPS rate of loaded POD files and will play them back at the FPS set using the slider PVRShaman 39 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Qg Imagination 3 2 Viewport The Viewport tab enables the appearance of the Visualization Panel to be modi
53. the objects distance through its animation Range 0 to 1 GEOMETRYCOUNTER int Resets to 0 at the beginning of each render frame and increases by one for each submission of geometry VIEWPORTPIX ELSIZE vec2 Size of the viewport in pixels Revision PowerVR SDK REL_3 5 3523383a 46 User Manual QF imagination Public Imagination Technologies Keyword Format description VIEWPORTCLIPPING vec4 Near distance far distance width angle radians height angle radians TIME float The current time in seconds TIMECOS float Cosine of the current time in seconds TIMESIN float Sine of the current time in seconds TIMETAN float Sine of the current time in seconds TIME2PI float Tangent of the current time in seconds TIME2PICOS float Cosine of the current time in seconds wrapped to 2 pi TIME2PISIN float Sine of the current time in seconds wrapped to 2 pi TIME2PITAN Float Tangent of the current time in seconds wrapped to 2 pi LASTTIME float The last frame s time ELAPSEDTIME float The time between adjacent frames BOUNDINGCENTER vec3 Bounding box centre BOUNDINGSPHERERADIUS float Bounding sphere radius BOUNDINGBOXSIZE vec3 Bounding box size BOUNDINGBOXMIN vec3 Bounding minimum for x y Z BOUNDINGBOXMAX vec3 B
54. tion of the GUI Show or Hide the Scene Explorer Window To display the Scene Explorer in the GUI select the relevant option from the menu Show or Hide the POD Explorer Window To display the POD Explorer in the GUI select the relevant option from the menu Show or Hide the Compiler Output Window If the Compiler Output option is ticked then the relevant panel will be visible on the GUI 2 2 7 Tools Menu The Tools menu Figure 12 allows accessing the Preferences dialog Tools Help Preferences Figure 12 Tools menu Preferences Preferences opens the Preferences dialog a full description of which can be found in Section 3 Preferences The dialog can also be opened via a shortcut on the main toolbar Revision PowerVR SDK REL_3 5 3523383a 16 User Manual KE Imagination Public Imagination Technologies 2 2 8 Help Menu The Help menu Figure 13 is used to access version information provide feedback and force updates for PVRShaman PVRShaman Help Fl PFX Specification Ctrl F1 PFX Semantics F12 Feedback Check for Updates About PVRShaman Figure 13 Help menu View PVRShaman User Manual To view the PVRShaman User Manual click Help gt PVRShaman Help View PFX Specification Document To view the PFX Specification click Help gt PFX Specification View PFX Semantics PFX Semantics opens a window containing a list of all of the semantics available to PVRShaman
55. tit il ad 32 Table 9 General Options vicodin ia alli dba 39 Table 10 Viewport Options acc ies ieee ees nie ee ik eee ee ie eed eee 40 Table 11 Compiler Settings Options cceccceeececeeeeeeeeeeeeeeeeeeeeeeeaeeeeaaeseneeecaaeeesaaeseeaeeseaeeessaeeesaeeneeees 41 Table 12 Editor Settings Options cooonccinnnnnonnccnnccnnnnannnccnn cnc n nr arrancar 42 Table 13 Editor Colours Options ooooocnnccnnnnnnoncccnnnccnnorann narran cnn 43 Table 14 Attribute Jet e noia 45 Table 15 Unit MIS tuno oleada liada bea dieta 45 Table 16 Regular expression syntax and description 48 Revision PowerVR SDK REL_3 5 3523383a 4 User Manual QF imagination Public Imagination Technologies 1 Introduction 1 1 Document Overview The purpose of this document is to serve as a complete user manual for the PVRShaman Shader Development Environment It includes compatibility information installation instructions a guide to the functionality of the application and a complete listing of all interface options and preferences 1 2 Software Overview PVRShaman is a tool for the rapid prototyping development and testing of OpenGL ES 2 0 OpenGL DirectX9 and DirectX10 shaders It provides a universal shader compiler and editor with syntax highlighting and per line cycle counts for rapid shader development and a Visualization Panel where the results of shader changes can be seen in real time Shader development is done in either PowerVR Effects
56. tructions ni d PowerVR Effect File GLSL ES Y Line1 Col 1 Figure 1 PVURShaman GUI At the left hand side of the GUI are the windows for the Scene Explorer Figure 1a and POD Explorer Figure 1b These are detailed further in Section 2 3 1 The majority of the GUI is taken up by the Visualization Panel Figure 1c which displays POD files or can be switched to display the Shader Editor with compiler output information displayed in the Compiler Output window Figure 1d Figure 1e displays the Task List window which details the state of the loaded files and any error that they may contain 2 1 1 Effects Editor The Effects Editor panel and the Compiler Output window are the home of PVRShaderEditor see Section 2 4 3 PVRShaderEditor can be used to edit GLSL code PFX and FX files as well as plain text files In addition to the functionality already described opened files are arranged as tabs so that multiple files can be opened at any given time Figure 2 Right clicking within an open file brings up a context menu that allows for easy insertion of attributes or uniforms as well as the normal array of copy and paste options Note Full information on the functionality found in PVRShaderEditor can be accessed in the PVRShaderEditor User Manual PVRShaman 7 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Scene Editor xb BB
57. u Fit Objects Fit Selected will zoom the Visualization Panel in out to fit the currently selected object and centres the object within the panel Selecting Fit A11 will instead zoom the Visualization Panel in out to fit the entire scene and centres the scene within the panel These functions can also be triggered via the panel toolbar Centre Selected To simply centre the current view in the panel on the currently selected object click Centre Selected Toggle between Showing and Hiding Objects Hide A11 hides all objects in the scene and Unhide A11 undoes the action Both of these functions can be triggered from the toolbar PVRShaman 11 Revision PowerVR SDK REL_3 5 3523383a Imagination Technologies Public Co imagination Modify Camera Properties Current View Properties displays the Modify Camera Properties dialog for the currently selected camera Add Material Add Material brings up the Add Material dialog as detailed in the Add Material section Assign Material Assign Material is used to assign a given material to a given mesh Delete Material To delete a selected material click Delete Material or select the associated icon from the main toolbar Change the Background Colour Background Colour changes the background colour of the Visualization Panel Save a Screenshot Save Screenshot saves a screenshot of the current contents of the Visualization Panel Select an Object This radio button changes the cont
58. upport system https ovrsupport imgtec com To learn more about our PowerVR Graphics SDK and Insider programme please visit http www powervrinsider com For general enquiries please visit our website http imgtec com corporate contactus asp Revision PowerVR SDK REL_3 5 3523383a 44 User Manual CJ Imagination Public Imagination Technologies Appendix B PVRShaman PFX Semantics List PFX Semantics are keywords that are used within the EFF uniform or attribute refers to In a normal application this information would be calculated on the CPU during the render loop and passed to the shader as editing the render loop to control what data is passed to the shader is not possible in PVRShaman These keywords allow for this information to be simulated correctly B 1 Attrib utes Table 14 lists all the attributes used in PVRShaman ECT block to signify what a given Table 14 Attribute list Format description POSITION vec4 Position NORMAL vec3 Normal TANGENT vec3 Tangent BINORMAL vec3 Binormal UV n vec2 n th set of UVs Example UVO VERTEXCOLOR vec4 Vertex colour attribute BONE INDEX vec4 Bone Index BONEWEIGHT vec4 Bone Weight B 2 Uniforms Table 15 lists the uniforms used by PVRShaman Table 15 Uniform list Format description

Download Pdf Manuals

image

Related Search

Related Contents

高機能インバータ  Kobe Range Hoods CH0136SQB User's Manual  Sony Xperia V 8GB 4G Pink  Printman 2  I-Trade Eclipse Trading Terminal  Portable Ultrasonic Energy meter Type  電波時計 取扱説明書  Rollei 0.28x Tele fish    LUNDI 2 FÉVRIER 2015/N° 377  

Copyright © All rights reserved.
Failed to retrieve file