Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2804034
prepare support for RGBA color model
schwicke Jun 13, 2026
c59ffa2
breaking change: redefine behavior of psalch
schwicke Jun 14, 2026
f520b77
add printing of PELEM_ALPHA_CHANNEL
schwicke Jun 14, 2026
f4885ce
fix dot and cirle markers
schwicke Jun 14, 2026
5e242b0
correct marker type after picking
schwicke Jun 14, 2026
8b6ae59
add pscm and pset_color_model new bindings
schwicke Jun 15, 2026
11f46e1
add PRGBA to phigsf77.h
schwicke Jun 15, 2026
f761f12
Change source of model type in two more functions
schwicke Jun 15, 2026
5ec3488
improve error handling and define transparent default colors
schwicke Jun 16, 2026
1000c60
Fix logic in color creation, roll back mode source in attr_plus funct…
schwicke Jun 16, 2026
535c77c
formatting changes only
schwicke Jun 17, 2026
1463b0d
put back culling
schwicke Jun 17, 2026
90178b4
add transparency to background
schwicke Jun 17, 2026
3d2cbd0
mostly reformatting
schwicke Jun 17, 2026
9be08f3
implement PHIGS_HLHSR_ID_ON_NZ not writing to Z buffer
schwicke Jun 18, 2026
ee70383
formatting, add type 80
schwicke Jun 18, 2026
352b2b8
add new mode to filling of hollow things
schwicke Jun 18, 2026
e92498e
use predefined transparency levels
schwicke Jun 18, 2026
e1bdfc0
use alpha in color setup for lights
schwicke Jun 18, 2026
1cea0f6
depth test should be enabled here
schwicke Jun 18, 2026
df6e320
reweight colors in lights
schwicke Jun 18, 2026
22be2ee
fix typo in css_pr.c
schwicke Jun 18, 2026
5409079
fix typos in wsgl.c
schwicke Jun 18, 2026
fb0b319
fix index for transparency
schwicke Jun 18, 2026
516da59
formatting only
schwicke Jun 18, 2026
e37028d
redo the shaders to ease editing
schwicke Jun 19, 2026
a8fc49e
make the used shader version configurable and use latest by default
schwicke Jun 19, 2026
1773d0e
Update README.md
schwicke Jun 19, 2026
2736d62
add missing argument in print statement
schwicke Jun 19, 2026
85832ed
fix linking of shared library on Ubuntu
schwicke Jun 19, 2026
273a73a
Reformatting shaders
schwicke Jun 19, 2026
404e5a8
ensure back_colr is initialised and reformat buffer
schwicke Jun 21, 2026
e2ece78
redo the shaders for 1.20 and make that the default
schwicke Jun 21, 2026
59cdd71
fix uninitialised alpha component in back interior color
schwicke Jun 21, 2026
c25b289
convert colours to current_colour_model and fix indentation
schwicke Jun 22, 2026
0eead8b
improve rendering when no shaders are in use
schwicke Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,49 @@ Extensions:
* echo area is given as a fraction of the root window

## Transparency

### PSALCH (DEPRECATED)
The ALPHA channel in a structure can be set with

CALL PSALCH(X)

where X is a floating point number between 0. (fully transparent) and 1. (fully opaque).

### RGBA Color mode
This version supports colors with 4 components. To switch to this mode, use PMODEL_RGBA instead of PMODEL_RGB which is the default. This
can be done via a call to PSCM(WKID, COLORMODE). Note that this call should be done directly after the workstation has been opened.
Use

COLORMODE=0 for PINDIRECT
COLORMODE=1 for PMODEL_RGB
COLORMODE=2 for PMODEL_RGBA

### Default colors
To pre-define some colors you can use

CALL PXSCM(WKID)

In COLORMODE=1 create 125 colors starting with index 16. Any colors with lower indices will not be touched.
In COLORMODE=2 same as above. In addition, it will create 5 levels of transparent colors for all colors, with offset 200 with decreasing transparency. This is done as well for any existing colors with indices between 1 and 15.

## Extensions
### Fortran bindings
* PXNDEF(STRING NAME): set the configuration location and file name
* PXSHCSF(INTEGER IWK, REAL VALUE): Set hardcopy scale factor for workstation ID WKID. Must be set before the workstation is being opened.
* PXQHCSF(INTEGER IWK, REAL VALUE): Inquire the current scale factor for workstation ID WKID. The value is returned in the second argument.

* PSALCH(REAL VALUE): set ALPHA channel to Value. Value is between 0(fully transparent) and 1 (opaque). Added to the current structure.
* PSALCH(REAL VALUE): (deprecated) set ALPHA channel to Value. Value is between 0(fully transparent) and 1 (opaque). Added to the current structure.
* PSFNAME(INTEGER IWK, CHARACTER FNAME): set output file name for workstation ID IWK
* PXSCM(): Set color map

### C-bindings
* pxset_conf_file_name(char* path): set the configuration location and file name
* pxset_conf_hcsf(WKID, Pfloat value): Set hardcopy scale factor for workstation ID WKID. Must be set before the workstation is being opened
* Pfloat pxinq_conf_hcsf(WKID): Inquire the current hardcopy scale factor for workstation ID WKID.

* pxset_conf_hcsf(int wkid, Pfloat value): Set hardcopy scale factor for workstation ID WKID. Must be set before the workstation is being opened
* Pfloat pxinq_conf_hcsf(int wkid): Inquire the current hardcopy scale factor for workstation ID WKID.
* pset_alpha_channel(float value): C-Binding for PSALCH. Added to the current structure.
* pxset_color_map(int wkid): set color map

### Configuration file
By default, OpenPHIGS will look for a file named phigs.def in the current directly, and use it to apply default values. This is where you can set window names, backgrounds etc. Explanations can be found in the template shipped with the distribution.

## Versions
* 0.0.1-1: Revised code from upstream
Expand All @@ -159,3 +181,4 @@ where X is a floating point number between 0. (fully transparent) and 1. (fully
* v0.3-2: C style fixings
* v0.3-3: test_f5 review, code improvements, clipping review
* V0.4-1: bug fixes, improve Wayland support, edge-cases on Mac and add support for a second clipping plane
* V0.5-1: Improved support for transparency
16 changes: 14 additions & 2 deletions phigs.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ Example Parameters for workstation 1
Enabled switches: %XX, Comment by replacing the % by some other character

Global flags:
%gs 1 Use shaders (1) or not (0)
%gs 1 Use shaders (1) or not (0)
%vs 120 Vertex shader version 1.30
%fs 120 Fragment shader version 1.30
%pc 1 print configuration. Set to 0 to disable.

Parameters set for all workstations: kept for historical reasons
Expand All @@ -13,27 +15,32 @@ Parameters set for all workstations: kept for historical reasons
%fp 6x13
%cm 3
%pa 2
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Per workstation configurations
%wk 4 workstation for rendering
%bs no
%wn Markers workstation name
%in Markers workstation icon name
%wg 512 512 0 0 1 Window width height px py border
%bg 0. 0. 0. Background color R G B
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Workstation example for output as tga
%wk 99 Workstation for hardcopy
%wg 1024 1024 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A
%hs 3. scale factor for hardcopy

Workstation example for output png
%wk 98 Workstation for hardcopy
%wg 1024 1024 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A
%hs 2. scale factor for hardcopy

Workstation example for output pnga
Expand All @@ -42,31 +49,36 @@ Workstation example for output pnga
%wp 0.0 1.0 0.0 1. position
%hs 1. scale factor for hardcopy
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Workstation example for output eps
%wk 96 Workstation for hardcopy
%wg 2480 3508 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%hs 1. scale factor for hardcopy
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Workstation example for output pdf
%wk 95 Workstation for hardcopy
%wg 2480 3508 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%hs 1. scale factor for hardcopy
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Workstation example for output svg
%wk 94 Workstation for hardcopy
%wg 2480 2480 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%hs 1. scale factor for hardcopy
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A

Workstation example for output obj
%wk 93 Workstation for hardcopy
%wg 2480 2480 0 0 1 Window width height px py border
%wp 0.0 1.0 0.0 1. position
%hs 1. scale factor for hardcopy
%bg 0. 0. 0. Background color R G B
%bga 0. 0. 0. 0.5 Background color R G B A
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set(GLEW_VERBOSE ON)
# for debugging
add_definitions(-g)
# add_definitions(-DTEST)
# add_definitions(-DDEBUGA)
# add_definitions(-DDEBUG)
# add_definitions(-DDEBUGL)
# add_definitions(-DDEBUGINP)
Expand Down
3 changes: 2 additions & 1 deletion src/include/phigs/phconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ extern "C" {
char filename[512]; /* Output filename for hard copies */
int set_window_pos;
Plimit vpos;
Pcolr_rep background_color;
Pcolr_rep background_color_rgb;
Pcolr_rep background_color_rgba;
unsigned int display_width;
unsigned int display_height;
unsigned int border_width;
Expand Down
Loading
Loading