[KH/DM/TDM] SpireControl5

Community reviews of maps (both official and user-made).

Moderators: Nexuiz Moderators, Moderators

Review:

Good
1
17%
Medium
2
33%
Bad
2
33%
Bad due to author of map
0
No votes
Bad due to largeness
1
17%
 
Total votes : 6

Postby take_this_cup_of_poison » Mon Sep 22, 2008 2:05 am

I'm very dissapointed that this does not work, there are no places that explain it indepth, and that in opengl 1.x cards (like any crappy laptop) it defaults to the secondary texture (the walls) rather than the primary (the grass). I was very excited that I could make it look good, but it was a false hope. That was upsetting.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby take_this_cup_of_poison » Mon Sep 22, 2008 2:28 am

Anyway, if there's a way to do this that falls back to the grass texture if need be, then that would be fine.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby torus » Mon Sep 22, 2008 2:50 am

Sure- just replace the first texture with the second one. If you look at my original shader, it has a similar arrangement (grass as the first one, rock as the second one). Keep them like this (in this order), and grass will appear if Dotproduct is disabled.
Image
torus
Forum addon
 
Posts: 1341
Joined: Sun Dec 24, 2006 6:59 am
Location: USA

Postby divVerent » Mon Sep 22, 2008 6:11 am

For more control about such things, I added a dotProduct2scale keyword to NetRadiant svn.

usage:

q3map_alphagen dotProduct2Scale ( X Y Z MIN MAX )

example:

q3map_alphagen dotProduct2Scale ( 0 0 1 0 1 ) = same as if not scaling
q3map_alphagen dotProduct2Scale ( 0 0 1 1 0 ) = inverted alpha range (so it uses alpha 1 for rocks, alpha 0 for grass)
q3map_alphagen dotProduct2Scale ( 0 0 1 -0.3473 1.0419 ) = some parts get "flat" (to be exact, anything below 10 degrees becomes flat grass, anything above 60 degrees becomes rock)

Reason for this is: cos(60 degrees)^2 = 1/4, 1/4 of the range -0.3473 to 1.0419 is 0, which is the alpha for rock.
cos(10 degrees)^2 = 0.9698, 0.9698 of the range -0.3473 to 1.0419 is 1, which is the alpha for grass.
Anything below 10 degrees will stay grass, anything above 60 degrees will stay rock.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby take_this_cup_of_poison » Tue Sep 23, 2008 1:20 am

How do I scale up the textures in the shader. I want the grass to be as big as it is in the original.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby take_this_cup_of_poison » Tue Sep 23, 2008 2:00 am

Can a shader be posted that will have the grass as the default texture, but have cliffs as the rock and scale the textures up to normal "1x" scaling, rather than the 0.5 or 0.25x scaling it is now.

Also is it possible to shade 3 textures together? My rock texture doesn't look so good.

Also is it possible to shade like... you know when you're tiling a texture you sometimes take that texture, blow it up 8X or 4X, and alphablend it over the tiling to make it look less monotonous.

Also can you show how to change the angles, say if I wanted 100% grass texture up untill 30 degrees, etc.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby divVerent » Tue Sep 23, 2008 7:12 am

Assuming your posted shader works fine:

Code: Select all
textures/spirecontrolshaders/terrain
{
   qer_editorimage textures/arboria/rockmod.tga
   q3map_lightmapSampleOffset 8
   q3map_globalTexture
   q3map_nonplanar
   q3map_shadeangle 95
   q3map_alphaMod dotproduct2scale ( 0 0 1 1.5 -0.5 )
   q3map_tcmod scale 0.5 0.5 // <---------------- change these numbers for the scaling you want
   q3map_tcMod rotate 30

   {
      map textures/bztourny/arkhart-grass2.png  // Primary
   }

   {
      map textures/bztourny/ppracer_rock.png   // Secondary
      blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA     
      alphaGen vertex
   }

   {
      map $lightmap
      blendFunc GL_DST_COLOR GL_ZERO
   }
}


Three textures cannot be shaded together - but for that you can use the indexmap feature instead of dotproduct2. Ask Morphed on how to use it. It IIRC needs special terrain generator tools, not sure if SavageX's generator supports it. Too bad ons-reborn is accidentally closed source (Morphed forgot to commit a file that is important, namely, test3.pcx, I asked him about it).

As for the angles changing:

Assume you want to have 0 alpha (that is, just the background layer) at X degrees, and 1 alpha at Y degrees. Then solve the equations, e.g. in maxima:

Code: Select all
(%i1) expand_to_range(f, min, max) := min + (max-min) * f;
(%o1)         expand_to_range(f, min, max) := min + (max - min) f
(%i2) deg2rad(a) := a * atan(1) / 45;
                                          a atan(1)
(%o2)                       deg2rad(a) := ---------
                                             45
(%i3) alpha(angle, min, max) := expand_to_range(cos(deg2rad(angle))^2, min, max);
                                                   2
(%o3) alpha(angle, min, max) := expand_to_range(cos (deg2rad(angle)), min, max)
(%i4) solve([alpha(X, min, max) = 0, alpha(Y, min, max) = 1], [min, max]);
                        2 %pi X                        2 %pi X
                     cos (-----)                    cos (-----) - 1
                           180                            180
(%o4) [[min = -------------------------, max = -------------------------]]
                 2 %pi X       2 %pi Y            2 %pi X       2 %pi Y
              cos (-----) - cos (-----)        cos (-----) - cos (-----)
                    180           180                180           180
(%i6) %o4, X=10, Y=60, numer;
(%o6)       [[min = 1.347296355333861, max = - .04188906600158222]]
(%i7) %o4, X=30, Y=60, numer;                                                   
(%o7)              [[min = 1.5, max = - .4999999999999998]]


So for 30 and 60 degrees as cutoffs, you'd put 1.5 and -0.5 in the shader, like I did above.

Actually, you can also use the formulas derived by maxima directly.

min = cos(X)^2 / (cos(X)^2 - cos(Y)^2)
max = (cos(X)^2 - 1) / (cos(X)^2 - cos(Y)^2)

As an extra bonus - you may want to use dotProductScale for a slightly different effect, then you let all the ^2 from the formulas away.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby take_this_cup_of_poison » Tue Sep 23, 2008 12:10 pm

q3map_tcmod scale 0.5 0.5

Before I changed that from 1.7 1.7 to 10 10 and it did nothing.
(I didn't recompile though).

Also is it ignored in opengl 1.x?

How do you add phong shading btw?

This looks worse then original textures because of the small tiling and only 2 texture blending (maybe I should use torus's rock texture instead?).

Since 1.7x scaling was tiny, and 10 didn't change anything, I can't really use this as the scaling is way too small.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby take_this_cup_of_poison » Tue Sep 23, 2008 12:37 pm

q3map_tcmod scale 1.5 1.5 // <---------------- change these numbers for the scaling you want
Image

q3map_tcmod scale 3.5 3.5 // <---------------- change these numbers for the scaling you want
Image


It doesn't work.
It is TOTALLY ignored (nexuiz 2.4.2)
I cannot use this. It is worthless except for small spaces.
Sorry. I can't improve my map using these shaders because they tile everything tiny.

Please give me other additional ways to improve the map because texture blending makes things look terrible.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby take_this_cup_of_poison » Tue Sep 23, 2008 12:39 pm

I want it to be the scaling I have in the current (original) map. Can you give me a shader that does exactly that. q3mod scale does NOT work at all. It is ignored.

(Please. the whole shader. without things that need changing)
Also I need a grey kind of cliff rock.
And please tell me how to change the angles. Give me a forumula please.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

PreviousNext

Return to Nexuiz - Map Reviews

Who is online

Users browsing this forum: No registered users and 1 guest

cron