Skip to content

testshade --shader <shadername> <layername>#763

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:masterfrom
lgritz:lg-testshade
Jun 2, 2017
Merged

testshade --shader <shadername> <layername>#763
lgritz merged 1 commit intoAcademySoftwareFoundation:masterfrom
lgritz:lg-testshade

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Jun 2, 2017

--shader is like a combination of --layer, and then naming the shader to create an instance of it.

The reason I prefer --shader is that when you use it, the command line is almost identical to the shader group serialization. So much nicer!

For example:

$ testshade -param texturename "grid.tx" \
            -shader texturemap tex1 \
            -param frequency 4.0 \
            -shader noisy noise1 \
            -param scale 1.0 \
            -shader contrast cont1 \
            -shader umixer mix1 \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg

corresponds very symmetrically to the shader group

param texturename "grid.tx" ;
shader texturemap tex1 ;
param frequency 4.0 ;
shader noisy noise1 ;
param scale 1.0 ;
shader contrast cont1 ;
shader umixer mix1 ;
connect tex1.out cont1.in ;
connect cont1.out mix1.left ;
connect noise1.out mix1.right ;

whereas, in comparison, using the old --layer notation works, but is
a less direct mapping to the serialization format:

$ testshade -layer tex1 -param texturename "grid.tx" texturemap \
            -layer noise1 -param frequency 4.0 noisy \
            -layer cont1 -param scale 1.0 contrast \
            -layer mix1 umixer \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg

`--shader` is like a combination of --layer, and then naming the shader
to create an instance of it.

The reason I prefer --shader is that when you use it, the command
line is almost identical to the shader group serialization. So much nicer!

For example:

```
$ testshade -param texturename "grid.tx" \
            -shader texturemap tex1 \
            -param frequency 4.0 \
            -shader noisy noise1 \
            -param scale 1.0 \
            -shader contrast cont1 \
            -shader umixer mix1 \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg
```

corresponds very symmetrically to the shader group

```
param string texturename "grid.tx" ;
shader texturemap tex1 ;
param float frequency 4.0 ;
shader noisy noise1 ;
param float scale 1.0 ;
shader contrast cont1 ;
shader umixer mix1 ;
connect tex1.out cont1.in ;
connect cont1.out mix1.left ;
connect noise1.out mix1.right ;
```

whereas, in comparison, using the old --layer notation works, but is
a less direct mapping to the serialization format:

```
$ testshade -layer tex1 -param texturename "grid.tx" texturemap \
            -layer noise1 -param frequency 4.0 noisy \
            -layer cont1 -param scale 1.0 contrast \
            -layer mix1 umixer \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg
```
@fpsunflower
Copy link
Copy Markdown
Contributor

LGTM

@lgritz lgritz merged commit 07b2406 into AcademySoftwareFoundation:master Jun 2, 2017
@lgritz lgritz deleted the lg-testshade branch June 2, 2017 23:11
lgritz added a commit to lgritz/OpenShadingLanguage that referenced this pull request Jun 7, 2017
…n#763)

`--shader` is like a combination of --layer, and then naming the shader
to create an instance of it.

The reason I prefer --shader is that when you use it, the command
line is almost identical to the shader group serialization. So much nicer!

For example:

```
$ testshade -param texturename "grid.tx" \
            -shader texturemap tex1 \
            -param frequency 4.0 \
            -shader noisy noise1 \
            -param scale 1.0 \
            -shader contrast cont1 \
            -shader umixer mix1 \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg
```

corresponds very symmetrically to the shader group

```
param string texturename "grid.tx" ;
shader texturemap tex1 ;
param float frequency 4.0 ;
shader noisy noise1 ;
param float scale 1.0 ;
shader contrast cont1 ;
shader umixer mix1 ;
connect tex1.out cont1.in ;
connect cont1.out mix1.left ;
connect noise1.out mix1.right ;
```

whereas, in comparison, using the old --layer notation works, but is
a less direct mapping to the serialization format:

```
$ testshade -layer tex1 -param texturename "grid.tx" texturemap \
            -layer noise1 -param frequency 4.0 noisy \
            -layer cont1 -param scale 1.0 contrast \
            -layer mix1 umixer \
            -connect tex1 out cont1 in \
            -connect cont1 out mix1 left \
            -connect noise1 out mix1 right \
            -g 256 256 -o out noisetex.jpg
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants