Replaced 'code-block' with 'sourcecode'.

This commit is contained in:
Daviw Williams
2013-05-16 16:19:38 +02:00
parent c806da9bb7
commit db1c2bf0f8
4 changed files with 14 additions and 14 deletions

View File

@ -23,7 +23,7 @@ The description here is rather oversimplified, but the idea behind these operati
Further information about the derivative operations can be found in the OpenGL/Direct3D API documentation, but the implementation in code is quite simple. Firstly you need to make sure that you have access to the fragments world space position in your shader, which means you need to pass it through from the vertex shader. Then you can use the following code in your fragment shader:
.. code-block:: glsl
.. sourcecode:: glsl
vec3 worldNormal = cross(dFdy(inWorldPosition.xyz), dFdx(inWorldPosition.xyz));
worldNormal = normalize(worldNormal);