Skip to content

Commit

Permalink
Add support for render groups 42, 43
Browse files Browse the repository at this point in the history
Why would you need a scaling for the specular texture? I don't get it. But XPS supports it, so here it is.
  • Loading branch information
cochrane committed Jun 17, 2017
1 parent 41c7490 commit 7e765ab
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
64 changes: 64 additions & 0 deletions GLLara/Model Parameters/xnaLaraDefault.modelparams.plist
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@
</dict>
<key>renderParameterDescriptions</key>
<dict>
<key>specularTextureScale</key>
<dict>
<key>title</key>
<string>Specular Texture Scale</string>
<key>min</key>
<real>0.01</real>
<key>max</key>
<string>32</string>
<key>description</key>
<string>How often the specular texture is repeated over the model. I have no idea why anyone would need this, but XPS supports it, so here we are.</string>
</dict>
<key>bump2UVScale</key>
<dict>
<key>title</key>
Expand Down Expand Up @@ -172,6 +183,59 @@
</dict>
<key>shaders</key>
<dict>
<key>DiffuseBumpSeparateSpecularScale</key>
<dict>
<key>defines</key>
<dict>
<key>SPECULAR_TEXTURE_SCALE</key>
<string>1</string>
<key>CALCULATE_TANGENT_TO_WORLD</key>
<string>1</string>
<key>SEPARATE_SPECULAR_TEXTURE</key>
<string>1</string>
<key>CAMERA_DIRECTION</key>
<string>1</string>
<key>DIFFUSE</key>
<string>1</string>
<key>AMBIENT_COLOR</key>
<string>1</string>
<key>VERTEX_COLOR</key>
<string>1</string>
<key>SPECULAR</key>
<string>1</string>
<key>RENDER_PARAMETERS</key>
<string>1</string>
<key>USE_SKINNING</key>
<string>1</string>
</dict>
<key>additionalParameters</key>
<array>
<string>bumpSpecularGloss</string>
</array>
<key>parameters</key>
<array>
<string>bumpSpecularAmount</string>
<string>specularTextureScale</string>
</array>
<key>textures</key>
<array>
<string>diffuseTexture</string>
<string>bumpTexture</string>
<string>specularTexture</string>
</array>
<key>alphaMeshGroups</key>
<array>
<string>MeshGroup43</string>
</array>
<key>solidMeshGroups</key>
<array>
<string>MeshGroup42</string>
</array>
<key>fragment</key>
<string>Combined.fs</string>
<key>vertex</key>
<string>Combined.vs</string>
</dict>
<key>DiffuseBumpSpecularEmission</key>
<dict>
<key>defines</key>
Expand Down
7 changes: 7 additions & 0 deletions GLLara/Shaders/Combined.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ uniform RenderParameters {
#ifdef REFLECTION
float reflectionAmount;
#endif
#ifdef SPECULAR_TEXTURE_SCALE
float specularTextureScale;
#endif
} parameters;
#endif

Expand Down Expand Up @@ -124,7 +127,11 @@ void main()
#endif
#ifdef SEPARATE_SPECULAR_TEXTURE
// Separate specular color
#ifdef SPECULAR_TEXTURE_SCALE
vec4 specularColor = texture(specularTexture, outTexCoord * parameters.specularTextureScale);
#else
vec4 specularColor = texture(specularTexture, outTexCoord);
#endif
#endif

// Base diffuse color
Expand Down

0 comments on commit 7e765ab

Please sign in to comment.