Merge branch 'fruitiex/textures' into fruitiex/runningmanctf
authorFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 19:53:35 +0000 (22:53 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sat, 24 Jul 2010 19:53:35 +0000 (22:53 +0300)
33 files changed:
models/fans/bigfan01.md3 [new file with mode: 0644]
models/fans/bigfan01.md3.framegroups [new file with mode: 0644]
models/fans/bigfan_light.md3 [new file with mode: 0644]
models/fans/bigfan_shadow.md3 [new file with mode: 0644]
models/fans/fanlight.tga [new file with mode: 0644]
models/fans/fanshadow.tga [new file with mode: 0644]
scripts/bigfan01.shader [new file with mode: 0644]
scripts/exx.shader
scripts/shader-audit.sh
textures/exx/floor/floor_wrn01-blue.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-blue_gloss.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-blue_norm.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-purple.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-purple_gloss.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-purple_norm.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-red.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-red_gloss.tga [new file with mode: 0644]
textures/exx/floor/floor_wrn01-red_norm.tga [new file with mode: 0644]
textures/procedural/floor01.tga [new file with mode: 0644]
textures/procedural/floor01_gloss.tga [new file with mode: 0644]
textures/procedural/floor01_norm.tga [new file with mode: 0644]
textures/procedural/floor02.tga [new file with mode: 0644]
textures/procedural/floor02_gloss.tga [new file with mode: 0644]
textures/procedural/floor02_norm.tga [new file with mode: 0644]
textures/procedural/floor03.tga [new file with mode: 0644]
textures/procedural/floor03_gloss.tga [new file with mode: 0644]
textures/procedural/floor03_norm.tga [new file with mode: 0644]
textures/procedural/floor04.tga [new file with mode: 0644]
textures/procedural/floor04_gloss.tga [new file with mode: 0644]
textures/procedural/floor04_norm.tga [new file with mode: 0644]
textures/procedural/fruitconcrete_purple.tga [new file with mode: 0644]
textures/procedural/fruitconcrete_purple_gloss.tga [new file with mode: 0644]
textures/procedural/fruitconcrete_purple_norm.tga [new file with mode: 0644]

diff --git a/models/fans/bigfan01.md3 b/models/fans/bigfan01.md3
new file mode 100644 (file)
index 0000000..9570ac5
Binary files /dev/null and b/models/fans/bigfan01.md3 differ
diff --git a/models/fans/bigfan01.md3.framegroups b/models/fans/bigfan01.md3.framegroups
new file mode 100644 (file)
index 0000000..8fd3d18
--- /dev/null
@@ -0,0 +1 @@
+0 30 5 1 // fan rotation speed is 3rd number, bigger = faster
\ No newline at end of file
diff --git a/models/fans/bigfan_light.md3 b/models/fans/bigfan_light.md3
new file mode 100644 (file)
index 0000000..1f24517
Binary files /dev/null and b/models/fans/bigfan_light.md3 differ
diff --git a/models/fans/bigfan_shadow.md3 b/models/fans/bigfan_shadow.md3
new file mode 100644 (file)
index 0000000..833291c
Binary files /dev/null and b/models/fans/bigfan_shadow.md3 differ
diff --git a/models/fans/fanlight.tga b/models/fans/fanlight.tga
new file mode 100644 (file)
index 0000000..54aa3da
Binary files /dev/null and b/models/fans/fanlight.tga differ
diff --git a/models/fans/fanshadow.tga b/models/fans/fanshadow.tga
new file mode 100644 (file)
index 0000000..db3136f
Binary files /dev/null and b/models/fans/fanshadow.tga differ
diff --git a/scripts/bigfan01.shader b/scripts/bigfan01.shader
new file mode 100644 (file)
index 0000000..001a496
--- /dev/null
@@ -0,0 +1,17 @@
+models/mapobjects/fans/fanlight.tga
+{
+ {
+       map models/fans/fanlight.tga
+       blendfunc add
+       tcmod rotate 40
+ }
+}
+
+models/mapobjects/fans/fanshadow.tga
+{
+ {
+       map models/fans/fanshadow.tga
+       blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+       tcmod rotate 40
+ }
+}
index 892b96c..12b9562 100644 (file)
@@ -709,6 +709,75 @@ textures/exx/floor-wrn01
        }
 }
 
+textures/exx/floor-wrn01-blue
+{
+       qer_editorimage textures/exx/floor/floor_wrn01-blue.tga
+       
+       q3map_bounceScale  0.75
+       dpoffsetmapping - 2
+       dpglossintensitymod  3
+       dpglossexponentmod  4
+
+
+       {
+               map textures/exx/floor/floor_wrn01-blue.tga
+               
+
+       }
+       {
+               map $lightmap
+               rgbGen identity
+               tcGen lightmap
+               blendfunc filter
+       }
+}
+
+textures/exx/floor-wrn01-red
+{
+       qer_editorimage textures/exx/floor/floor_wrn01-red.tga
+       
+       q3map_bounceScale  0.75
+       dpoffsetmapping - 2
+       dpglossintensitymod  3
+       dpglossexponentmod  4
+
+
+       {
+               map textures/exx/floor/floor_wrn01-red.tga
+               
+
+       }
+       {
+               map $lightmap
+               rgbGen identity
+               tcGen lightmap
+               blendfunc filter
+       }
+}
+
+textures/exx/floor-wrn01-purple
+{
+       qer_editorimage textures/exx/floor/floor_wrn01-purple.tga
+       
+       q3map_bounceScale  0.75
+       dpoffsetmapping - 2
+       dpglossintensitymod  3
+       dpglossexponentmod  4
+
+
+       {
+               map textures/exx/floor/floor_wrn01-purple.tga
+               
+
+       }
+       {
+               map $lightmap
+               rgbGen identity
+               tcGen lightmap
+               blendfunc filter
+       }
+}
+
 textures/exx/light-panel01
 {
        qer_editorimage textures/exx/light/light_panel01.tga
index 9b5d9d9..0d49617 100644 (file)
@@ -8,10 +8,13 @@ normalize()
        echo "$1" | sed 's/\.\(tga\|jpg\|png\)$//'
 }
 
+allowed_prefixes=
+forbidden_prefixes=
+
 textures_used=
 # $1 = shader
 # $2 = texture
-# $3 = self | map | animmap | editorimage
+# $3 = shader | map | animmap | editorimage | sky
 use_texture()
 {
        # does texture exist?
@@ -21,7 +24,7 @@ use_texture()
                [ -f "../$2.png" ]; then
                :
        else
-               if [ "$3" = "self" ]; then
+               if [ "$3" = "shader" ]; then
                        return
                else
                        echo "(EE) shader $1 uses non-existing texture $2"
@@ -29,7 +32,51 @@ use_texture()
        fi
        textures_used="$textures_used$LF$2"
 
-       # TODO verify shader -> texture name
+       if [ -n "$allowed_prefixes" ]; then
+               ok=false
+               for p in $allowed_prefixes; do
+                       case "$1:" in
+                               "$p"*)
+                                       ok=true
+                                       ;;
+                       esac
+               done
+       else
+               ok=true
+       fi
+       for p in $forbidden_prefixes; do
+               case "$1:" in
+                       "$p"*)
+                               ok=false
+                               ;;
+               esac
+       done
+       if ! $ok; then
+               echo "(EE) shader $1 is not allowed in this shader file (allowed: $allowed_prefixes, forbidden: $forbidden_prefixes)"
+       fi
+
+       case "$3" in
+               sky)
+                       case "$2" in
+                               env/*)
+                                       ;;
+                               *)
+                                       echo "(EE) texture $2 of shader $1 is out of place, $3 textures must be in env/"
+                                       ;;
+                       esac
+                       ;;
+               *)
+                       case "$2" in
+                               env/*)
+                                       echo "(EE) texture $2 of shader $1 is out of place, $3 textures must not be in env/"
+                                       ;;
+                               *)
+                                       ;;
+                       esac
+                       ;;
+       esac
+
+       # verify shader -> texture name
        case "$1" in
                textures/*x/*-*)
                        pre=${1%%x/*}x
@@ -55,6 +102,18 @@ use_texture()
                                        ;;
                        esac
                        ;;
+               textures/map_*/*)
+                       pre=${1%%/map_*}
+                       suf=${1#*/map_}
+                       map=${suf%%[_/]*}
+                       case "$2" in
+                               "$pre"/map_$map[/_]*)
+                                       ;;
+                               *)
+                                       echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $pre/map_$map/*"
+                                       ;;
+                       esac
+                       ;;
                textures/common/*)
                        case "$2" in
                                "$1")
@@ -72,7 +131,31 @@ use_texture()
                                        # I _suppose_ this is fine, as tZork committed this pack
                                        ;;
                                *)
-                                       echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1 or textures/common/*/*"
+                                       echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1"
+                                       ;;
+                       esac
+                       ;;
+               textures/skies/*)
+                       sky=${1#textures/skies/}
+                       sky=${sky%%_*}
+                       case "$2" in
+                               "$1")
+                                       # typical place for preview image
+                                       ;;
+                               env/$sky[/_]*)
+                                       # typical place for skybox
+                                       ;;
+                               *)
+                                       echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1"
+                                       ;;
+                       esac
+                       ;;
+               models/*)
+                       case "$2" in
+                               models/*)
+                                       ;;
+                               *)
+                                       echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1 or models/*"
                                        ;;
                        esac
                        ;;
@@ -112,12 +195,15 @@ parse_shaderstage()
 
 parse_shader()
 {
-       use_texture "$parsing_shader" "$parsing_shader" self
+       use_texture "$parsing_shader" "$parsing_shader" shader
        while read L A1; do
                case "$L" in
                        qer_editorimage\ *)
                                use_texture "$parsing_shader" "$A1" editorimage
                                ;;
+                       skyparms\ *)
+                               use_texture "$parsing_shader" "$A1" sky
+                               ;;
                        '{')
                                parse_shaderstage
                                ;;
@@ -132,9 +218,23 @@ parse_shader()
 
 parse_shaderfile()
 {
+       case "$1" in
+               map_*)
+                       allowed_prefixes="textures/map_`echo "$1" | cut -d _ -f 2`_ textures/map_`echo "$1" | cut -d - -f 2`/"
+                       forbidden_prefixes=
+                       ;;
+               skies_*)
+                       allowed_prefixes="textures/skies/`echo "$1" | cut -d _ -f 2`: textures/skies/`echo "$1" | cut -d _ -f 2`_"
+                       forbidden_prefixes=
+                       ;;
+               *)
+                       allowed_prefixes=
+                       forbidden_prefixes="textures/skies/ textures/map_"
+                       ;;
+       esac
        while read L; do
                case "$L" in
-                       textures/*)
+                       */*)
                                parsing_shader="`normalize "$L"`"
                                if [ x"$L" != x"$parsing_shader" ]; then
                                        echo "(WW) normalized shader name $L to $parsing_shader"
@@ -157,7 +257,7 @@ strip_comments()
 t=`mktemp`
 for X in *.shader; do
        strip_comments < "$X" > "$t"
-       parse_shaderfile < "$t"
+       parse_shaderfile "${X%.shader}" < "$t"
 done
 rm -f "$t"
 
@@ -168,6 +268,8 @@ echo "$textures_used$LF$textures_used$LF$textures_avail" | sort | uniq -u | whil
        case "$L" in
                textures/radiant/*)
                        ;;
+               textures/map_*/*)
+                       ;;
                *)
                        echo "(EE) texture $L is not referenced by any shader"
                        ;;
diff --git a/textures/exx/floor/floor_wrn01-blue.tga b/textures/exx/floor/floor_wrn01-blue.tga
new file mode 100644 (file)
index 0000000..f7df1d8
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-blue.tga differ
diff --git a/textures/exx/floor/floor_wrn01-blue_gloss.tga b/textures/exx/floor/floor_wrn01-blue_gloss.tga
new file mode 100644 (file)
index 0000000..13b83d8
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-blue_gloss.tga differ
diff --git a/textures/exx/floor/floor_wrn01-blue_norm.tga b/textures/exx/floor/floor_wrn01-blue_norm.tga
new file mode 100644 (file)
index 0000000..144a981
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-blue_norm.tga differ
diff --git a/textures/exx/floor/floor_wrn01-purple.tga b/textures/exx/floor/floor_wrn01-purple.tga
new file mode 100644 (file)
index 0000000..f448712
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-purple.tga differ
diff --git a/textures/exx/floor/floor_wrn01-purple_gloss.tga b/textures/exx/floor/floor_wrn01-purple_gloss.tga
new file mode 100644 (file)
index 0000000..13b83d8
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-purple_gloss.tga differ
diff --git a/textures/exx/floor/floor_wrn01-purple_norm.tga b/textures/exx/floor/floor_wrn01-purple_norm.tga
new file mode 100644 (file)
index 0000000..144a981
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-purple_norm.tga differ
diff --git a/textures/exx/floor/floor_wrn01-red.tga b/textures/exx/floor/floor_wrn01-red.tga
new file mode 100644 (file)
index 0000000..09e2082
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-red.tga differ
diff --git a/textures/exx/floor/floor_wrn01-red_gloss.tga b/textures/exx/floor/floor_wrn01-red_gloss.tga
new file mode 100644 (file)
index 0000000..13b83d8
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-red_gloss.tga differ
diff --git a/textures/exx/floor/floor_wrn01-red_norm.tga b/textures/exx/floor/floor_wrn01-red_norm.tga
new file mode 100644 (file)
index 0000000..144a981
Binary files /dev/null and b/textures/exx/floor/floor_wrn01-red_norm.tga differ
diff --git a/textures/procedural/floor01.tga b/textures/procedural/floor01.tga
new file mode 100644 (file)
index 0000000..ed84485
Binary files /dev/null and b/textures/procedural/floor01.tga differ
diff --git a/textures/procedural/floor01_gloss.tga b/textures/procedural/floor01_gloss.tga
new file mode 100644 (file)
index 0000000..798ea57
Binary files /dev/null and b/textures/procedural/floor01_gloss.tga differ
diff --git a/textures/procedural/floor01_norm.tga b/textures/procedural/floor01_norm.tga
new file mode 100644 (file)
index 0000000..09e9bd4
Binary files /dev/null and b/textures/procedural/floor01_norm.tga differ
diff --git a/textures/procedural/floor02.tga b/textures/procedural/floor02.tga
new file mode 100644 (file)
index 0000000..9a51863
Binary files /dev/null and b/textures/procedural/floor02.tga differ
diff --git a/textures/procedural/floor02_gloss.tga b/textures/procedural/floor02_gloss.tga
new file mode 100644 (file)
index 0000000..74cc179
Binary files /dev/null and b/textures/procedural/floor02_gloss.tga differ
diff --git a/textures/procedural/floor02_norm.tga b/textures/procedural/floor02_norm.tga
new file mode 100644 (file)
index 0000000..13e856c
Binary files /dev/null and b/textures/procedural/floor02_norm.tga differ
diff --git a/textures/procedural/floor03.tga b/textures/procedural/floor03.tga
new file mode 100644 (file)
index 0000000..b0d4d85
Binary files /dev/null and b/textures/procedural/floor03.tga differ
diff --git a/textures/procedural/floor03_gloss.tga b/textures/procedural/floor03_gloss.tga
new file mode 100644 (file)
index 0000000..79d694c
Binary files /dev/null and b/textures/procedural/floor03_gloss.tga differ
diff --git a/textures/procedural/floor03_norm.tga b/textures/procedural/floor03_norm.tga
new file mode 100644 (file)
index 0000000..450c175
Binary files /dev/null and b/textures/procedural/floor03_norm.tga differ
diff --git a/textures/procedural/floor04.tga b/textures/procedural/floor04.tga
new file mode 100644 (file)
index 0000000..71ce980
Binary files /dev/null and b/textures/procedural/floor04.tga differ
diff --git a/textures/procedural/floor04_gloss.tga b/textures/procedural/floor04_gloss.tga
new file mode 100644 (file)
index 0000000..d4b4f56
Binary files /dev/null and b/textures/procedural/floor04_gloss.tga differ
diff --git a/textures/procedural/floor04_norm.tga b/textures/procedural/floor04_norm.tga
new file mode 100644 (file)
index 0000000..db7045c
Binary files /dev/null and b/textures/procedural/floor04_norm.tga differ
diff --git a/textures/procedural/fruitconcrete_purple.tga b/textures/procedural/fruitconcrete_purple.tga
new file mode 100644 (file)
index 0000000..e6e1ff9
Binary files /dev/null and b/textures/procedural/fruitconcrete_purple.tga differ
diff --git a/textures/procedural/fruitconcrete_purple_gloss.tga b/textures/procedural/fruitconcrete_purple_gloss.tga
new file mode 100644 (file)
index 0000000..6bc8ab6
Binary files /dev/null and b/textures/procedural/fruitconcrete_purple_gloss.tga differ
diff --git a/textures/procedural/fruitconcrete_purple_norm.tga b/textures/procedural/fruitconcrete_purple_norm.tga
new file mode 100644 (file)
index 0000000..0d1c2bd
Binary files /dev/null and b/textures/procedural/fruitconcrete_purple_norm.tga differ