Shader Features:
- Supports up to 3 Lights
- Parallax Occlusion Mapping (:D)
A screenshot taken from my editor:

.hlsl, .program and .material files (for Ogre 1.6):
See page 3
ARTIFEX TERRA 3D - Artist-friendly, free and easy WYSIWYG realtime outdoor scene Editor & Painter
New loader now with Ogre::Terrain support: Addons for Artifex on SourceForge
MOC - Minimal Ogre Collision & Mousepicking
Simple TerrainMaterialGenerator for the use of standard Ogre material with Ogre::Terrain
Support me on Patreon
Code: Select all
float nMinSamples = 100;
float nMaxSamples = 200;
Code: Select all
fCurrHeight = tex2Dlod( normalHeightMap, float4(vTexCurrentOffset, 0, 0)).a;
Code: Select all
float Dist1 = length(lightPosition1 - position);
float Dist2 = length(lightPosition1 - position);
float Dist3 = length(lightPosition1 - position);
Code: Select all
float3 nNormal = normalize(normal);
float3 nTangent = normalize(tangent);
float3 binormal = cross(nTangent, nNormal);
No it isn't.The length of a cross is 1 if both vectors have the length 1.
I think he wanted to say it's in the range [-1, 1]. When both vectors are normalised, their dot product returns the cosine of the angle they form as is, because it's multiplied by the length of both vectors (which in this particular case is exactly 1 for both)Kojack wrote:No it isn't.The length of a cross is 1 if both vectors have the length 1.
The length of a cross product is affected by the angle between the 2 vectors. The result is only length 1 if the 2 vectors are unit length and at 90 degrees to each other.
If the normal and tangent are always going to be at right angles, then it's fine. But that's a specific case.
Wait, is there a difference between what you're describing and what one of those gamedev.net geniuses posted? Because the demo he provides runs with perfect quality (no aliasing or errors on the edges whatsoever) at least 10 times faster than POM or relief mapping with 200 steps (even at which you can still notice errors).Oogst wrote:I meant self shadowing, because you can do that really easy once you have the ray marching working.
As for the relaxed cone step mapping: it is a pretty difficult one to implement, because it also requires a tool to generate the cone step map in the first place. Requires a lot of time to make, I would expect. That's why I first asked whether you are having fun with this.Relaxed cone step mapping is an awesome algorithm, though!
I don't know, can you provide a link to the GameDev.net post? Cone Step Mapping and Relaxed Cone Mapping are described in GPU Gems 2 & 3 respectively, and the image in there are very good quality.nullsquared wrote:Wait, is there a difference between what you're describing and what one of those gamedev.net geniuses posted? Because the demo he provides runs with perfect quality (no aliasing or errors on the edges whatsoever) at least 10 times faster than POM or relief mapping with 200 steps (even at which you can still notice errors).