Example a_backup/testing/display_modes: Display modes example.

This example tests many combinations of various display modes by looking at the corner of a cube.


The comfile run by this example is as follows:

#display_modes.com

$width = 100;
$height = 100;

gfx read node $example/cube.exnode;
gfx read element $example/cube.exelem;

gfx create egroup face_one add 1;
gfx create egroup face_two add 2;
gfx create egroup face_three add 3;
gfx create egroup face_four add 4;
gfx create egroup face_five add 5;
gfx create egroup face_six add 6;

gfx create material red ambient 0.5 0 0 diffuse 1 0 0 emission 0 0 0 specular 0.2 0.2 0.2 alpha 0.45 shininess 0.2;
gfx create material blue ambient 0 0 0.5 diffuse 0 0 1 emission 0 0 0 specular 0.2 0.2 0.2 alpha 0.37 shininess 0.2;
gfx create material white ambient 1 1 1 diffuse 1 1 1 emission 0 0 0 specular 0 0 0 alpha 0.53 shininess 0;
gfx create material green ambient 0 0.5 0 diffuse 0 1 0 emission 0 0 0 specular 0.2 0.2 0.2 alpha 1 shininess 0.1;
gfx create material silver ambient 0.4 0.4 0.4 diffuse 0.7 0.7 0.7 emission 0 0 0 specular 0.5 0.5 0.5 alpha 0.34 shininess 0.3;
gfx create material gold ambient 1 0.4 0 diffuse 1 0.7 0 emission 0 0 0 specular 0.5 0.5 0.5 alpha 1 shininess 0.3;

gfx modify g_element "/" general clear;
gfx modify g_element cube lines coordinate coordinates material default;
gfx modify g_element face_one lines coordinate coordinates material default;
gfx modify g_element face_one surfaces coordinate coordinates material blue render_shaded;
gfx modify g_element face_two lines coordinate coordinates material default;
gfx modify g_element face_two surfaces coordinate coordinates material gold render_shaded;
gfx modify g_element face_three lines coordinate coordinates material default;
gfx modify g_element face_three surfaces coordinate coordinates material green render_shaded;
gfx modify g_element face_four lines coordinate coordinates material default;
gfx modify g_element face_four surfaces coordinate coordinates material red render_shaded;
gfx modify g_element face_five lines coordinate coordinates material default;
gfx modify g_element face_five surfaces coordinate coordinates material silver render_shaded;
gfx modify g_element face_six lines coordinate coordinates material default;
gfx modify g_element face_six surfaces coordinate coordinates material white render_shaded;

gfx create window view;
gfx modify window view layout simple width $width height $height;
gfx modify window view view parallel eye_point 2.01023 -1.10862 3.40199 interest_point 0.5 0.5 0.5 up_vector -0.553287 0.572362 0.605206 view_angle 40 near_clipping_plane 2 far_clipping_plane 5 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;
#gfx modify window view view parallel eye_point 2.5 -1.5 2.8 interest_point 0.5 0.5 0.5 up_vector -0.437147 0.455019 0.775797 view_angle 40 near_clipping_plane 2 far_clipping_plane 5 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;

gfx create texture bob image $example/gt_barrier.sgi;

%antialias_modes = ();
$antialias_modes{"A1"} = "no_antialias";
#Current mesa library used in testing does not support MSAA
#$antialias_modes{"A2"} = "antialias 2";
#$antialias_modes{"A8"} = "antialias 8";

%blending_modes = ();
$blending_modes{"BN"} = "blend_normal";
$blending_modes{"B0"} = "blend_none";
$blending_modes{"BT"} = "blend_true_alpha";

%transparency_modes = ();
$transparency_modes{"FT"} = "fast_transparency";
$transparency_modes{"ST"} = "slow_transparency";
$transparency_modes{"LT"} = "layered_transparency 15";
#order_independent_transparency is not currently available on any of our testing platforms

%line_modes = ();
$line_modes{"NL"} = "normal_lines";
$line_modes{"PL"} = "perturb_lines";

%background_modes = ()
$background_modes{"BB"} = "colour 0 0 0 texture none";
$background_modes{"BW"} = "colour 1 1 1 texture none";
$background_modes{"BT"} = "colour 0 0 0 texture bob";
for $antialias_mode (keys %antialias_modes)
{
  for $blending_mode (keys %blending_modes)
  {
	 for $transparency_mode (keys %transparency_modes)
	 {
		for $line_mode (keys %line_modes)
		{
		  cmiss("gfx mod win view set $antialias_modes{$antialias_mode} $blending_modes{$blending_mode} $transparency_modes{$transparency_mode} $line_modes{$line_mode}");
		  for $background_mode (keys %background_modes)
		  {
			 cmiss("gfx mod win view background $background_modes{$background_mode}");

			 $filename = "image_${antialias_mode}_${blending_mode}_${transparency_mode}_${line_mode}_${background_mode}.sgi";
			 $filename =~ s/\s/_/g;

			 gfx print window view file $filename width $width height $height ;
		  }
		}
	 }
  }
}

Files used by this example are:

Name               Modified     Size

display_modes.com 20-Apr-2012 4.4k COPYRIGHT 19-Apr-2012 504 cube.exelem 20-Apr-2012 2.3k cube.exnode 20-Apr-2012 989 gt_barrier.sgi 20-Apr-2012 34k

Download the entire example:

Name                                            Modified     Size

examples_a_backup_testing_display_modes.tar.gz 12-Aug-2014 1.7M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:12:19 20164
cmgui-wx-debugSuccessSun Mar 6 00:14:12 20163
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:38 20161
last breakSun Mar 6 00:01:00 20161
last successWed Jun 3 00:05:00 20151
cmgui-wx-debugFailureSun Mar 6 00:01:49 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:05:00 20152

Testing status by file:


Html last generated: Sun Mar 6 05:51:01 2016

Input last modified: Fri Apr 20 16:02:02 2012


CMISS Help / Examples / a_backup / testing / display_modes