Jump to content

rend2 shader manual


eezstreet

Recommended Posts

This is more for my purposes than for anything else. Looking up the different shader stages in order to get a good tech demo worked on.

 

 

Shaders can be in either .shader or in .mtr.

 

 

Most of the original keywords still apply, with some differences.

 

Base shader data:

 

 

sun

This keyword has been removed (see below)

 

 

q3map_sun/q3map_sunext <R> <G> <B> <Pitch> <Yaw> <Roll>

Equivalent to sun.

 

 

q3gl2_sun <R> <G> <B> <Pitch> <Yaw> <Roll> <Light Scale> <Shadow Scale>

Altered sun shader. Has advanced shadow casting.

 

 

q3gl2_tonemap <R> <G> <B> <Exposure Min> <Exposure Max>

Use tonemaps? (not sure how this works)

 

 

 

Stage data:

 

 

map <blah>

This has an extra reserved keyword: $deluxemap

 

 

stage <blah>

This is a new keyword. The parameter can be one of the following:

diffuseMap

normalMap/bumpMap (identical in function)

normalParallaxMap/bumpParallaxMap (identical in function)

specularMap

 

 

specularReflectance <value>

For a specular stage, specifies how much reflectance there is

 

 

specularExponent <value>

For a specular stage, specifies the exponent for the glossiness

 

 

gloss <value>

For a specular stage, specifies how much glossiness there is

 

 

rgbGen

lightingDiffuseEntity now works correctly.

 

 

alphaGen

dot/oneMinusDot no longer works.

 

 

glow

This keyword no longer functions.

 

 

surfaceSprites

This keyword no longer functions. (for now)

 

 

Link to comment

Regarding levels. I can get models in ioquake3 to show off normal mapping in existing maps but when I try it on a wall texture, it just disappears so not sure what's going on there.

 

I can't seem to get a dynamic sun working either with the info ioquake3 provided. :\

Link to comment
  • 3 months later...

Yeah, cool. I think a shader manual for rend2 is a VERY good idea as I have no idea how to use any new shader commands aside from the normalmap ones. For example, cubemaps, distortion shaders e.t.c

 

Also, when it says..."alpha channel" for normalparralaxmaps....how does that work exactly?

Link to comment

For normalparallax, you have a single texture, where the regular normal map goes in the RGB channels, and then a height map for the parallax effect in the A channel. You'd need to save it as a TGA or PNG image.

 

I linked you this page in PM, but I'll link it again for anyone else to find:

 

https://github.com/ioquake/ioq3/blob/master/opengl2-readme.txt

 

This covers all the new shader syntax.

Link to comment

@@Szico VII

 

You can enable HDR and control tonemapping for your level, though I think HDR might be a bit buggy atm?

 

You should make a map with ioquake3 rend2, then port it to JKA to help Xycaleth with making sure all features are in. I was doing this, but I'm busy with DF2 & JK2:HD and you're more capable. :P

Link to comment

There's some stuff even in ioquake3 rend2 which need to be implemented (there's no bloom, cubemaps are WIP, there's some shader optimizations that need to take place, etc), as well as stuff which I'd like to see done (motion blur, LUT color grading, etc).

for right now, rend2 doesn't really offer any significant benefit but it will later down the line. The biggest priorities are to improve performance and stability more than adding these features.

Futuza and Stoiss like this
Link to comment
  • 3 weeks later...

There's cubemaps available now in OpenJK rend2, but not sure how well they work. From what I can tell in the code, it uses tcgen environment in the .shader/.mtr and you place misc_cubemap entities in your map.

 

 

New shader stuff in ioquake3's rend2:

 

normalScale <x> <y>

 

- State the X and Y scales of the normal map.  This is useful for increasing

  or decreasing the "strength" of the normal map, or entering negative values

  to flip the X and/or Y values.  Default 1 1.

 

 

parallaxDepth <value>

 

- State the maximum depth of the parallax map.  This is a fairly sensitive

  value, and I recommend the default or lower.  Default 0.05.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...