Sorry, I should have written
Isn’t pom just an algorithm which modifes vertex coordinates?
So the question is, if it’s POM (parallax occlusion mapping) or SPOM (steep parallax occlusion mapping).
Sorry, I should have written
Isn’t pom just an algorithm which modifes vertex coordinates?
So the question is, if it’s POM (parallax occlusion mapping) or SPOM (steep parallax occlusion mapping).
http://sunandblackcat.com/tipFullView.php?topicid=28
simple POM, so basically steep parallax with an interpolation step.
Ok, nice link!
I will look into it to figure out, which technique has which name
Maybe I will post some screenshots later also
do u mind to share how you to do POM and cutout?
Cutout simply discards if texcoord.x or y is <0 or >1
Do you mind to share the pom source code in ur shader.?
am on mobile but it’s a straight copy from the link
Edit:
here you go
float3 viewDir = normalize(cameraPositionTS - positionTS);
//steepness
float steepness = (1 - viewDir.z);
//float height = HeightMap.SampleLevel(TextureSampler, texCoords, sampleLevel);
//texCoords = texCoords + viewDir.xy * height * height_scale;
// number of depth layers
float numLayers = lerp(10, 40, steepness) * POMQuality;
// calculate the size of each layer
float layerDepth = 1.0 / numLayers;
// depth of current layer
float currentLayerDepth = 0.0;
float2 P = viewDir.xy/(max(viewDir.z, 0.2f)) * abs(height_scale);
float2 deltaTexCoords = P / numLayers;
float f1 = saturate(sign(height_scale));
float f2 = sign(-height_scale);
float2 currentTexCoords = texCoords;
float currentDepthMapValue = f1 + f2 *HeightMap.SampleLevel(TextureSampler, currentTexCoords, sampleLevel).r;
[loop]
while (currentLayerDepth < currentDepthMapValue)
{
// shift texture coordinates along direction of P
currentTexCoords -= deltaTexCoords;
// get depthmap value at current texture coordinates
currentDepthMapValue = f1 + f2 *HeightMap.SampleLevel(TextureSampler, currentTexCoords, sampleLevel).r;
// get depth of next layer
currentLayerDepth += layerDepth;
}
float2 prevTexCoords = currentTexCoords + deltaTexCoords;
// get depth after and before collision for linear interpolation
float afterDepth = currentDepthMapValue - currentLayerDepth;
float beforeDepth = f1 + f2 *HeightMap.SampleLevel(TextureSampler, prevTexCoords, sampleLevel).r - currentLayerDepth + layerDepth;
// interpolation of texture coordinates
float weight = afterDepth / (afterDepth - beforeDepth);
float2 finalTexCoords = lerp(currentTexCoords, prevTexCoords, weight); /* prevTexCoords * weight + currentTexCoords * (1.0 - weight);*/
if (POMCutoff)
if (finalTexCoords.x != saturate(finalTexCoords.x) || finalTexCoords.y != saturate(finalTexCoords.y))
{
discard;
}
this is for the texcoord, wat about Gbuffer depth &normal?
This is forward rendered
Ok. I am in!
Here’s a viewer I build to test if fbx files were exported correctly.
Also had a modified version to test for overdraw
an fbx model viewer? What a curious idea!
Looks pretty professional!
Ha! I know it’s not very original but there was a good reason for it.
The artist could test quickly if the fbx was exported with the correct setting that won’t cause any problems on the pipeline importer. scaling, bones, etc.
same reason for me too
and here’s my live-editing content pipeline.
Only works with Textures and sounds at the moment, there are still a couple of things to smooth out.
Is that your game editor?
Yeap!
…
For me at the moment it takes some time to write a new class for a model which I want to test in my engine. I apply the textures “by hand”. I had some cases where the preview on the page where I downloaded the model looked pretty good but when imported into my engine it looked not as expected. So I threw some away. On the other hand it is a little boring to have the same test models all the time
So a model viewer would be helpful for a quick preview of what the model would look like.
It’s funny how useful this is. I’ve installed 3 FBX viewers, and ALL of them stopped working after a day or so (the process starts, but the program is AWOL). I would love to test my animations in this! Did you use BetterSkinned for the animation?
No, it’s probably using the SkinningSample. I have to dig out the project files and update it to my current animation library. I can upload it as a sample if that’s gonna help others.