Layered Depth Image…?

I have an RGBZ-image (8 Byte per Plane) and i just noticed that the loader seems to support depth – what would be an image format i could use for that? its currently stored as a png-24 but the Z-Channel gets – of course – interpreted as Alpha. Does the renderer currently support RGBZ? What would be the correct format (i can easily hack the loader, i just have to know what format would get interpreted correctly by jme).

There isn’t really an application for this currently afaik. Parallax is normally used to displace meshes. What do you want to do? You could just layer separate quads with different images or just combine whatever maps however in a shader.
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

Just wanted to check performance. i created a normalmap from the Z-channel and it looks /ok/ but – of couse – doesnt look well from extreme angles. As the Z is already there, i wanted to know if there is any way to use it directly – eg – let the renderer decide if the pixel is seen. as this is a solid surface, there is nothing behind something else when you look staight on, so RGBZ is the perfect description of the surface. I was curious if something useful is in the renderer, that would bring better results in same performance as tex + norm.

As said, height maps as for parallax mapping make more sense as you don’t have a fixed camera angle in most games :wink: For lighting theres normal maps. Depth is mostly used when you get a rendered image from the GPU, e.g. for the water post effect the depth is used to determine where in the image the water should be painted.
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

Tried 3D textures? afaik we only have dds format support for them though

@normen said: the depth is used to determine where in the image the water should be painted

Wouldnt that exaclty be the z i need? i mean, do you tell the renderer “hey, that H2O is z=0.01 and its drunken left companion is z=0.07” or does the renderer give you the values and you provide final pixel color?

@rhavin said: Wouldnt that exaclty be the z i need? i mean, do you tell the renderer " hey, that H2O is z=0.01 and its drunken left companion is z=0.07 or does the renderer give you the values and you provide color?
As said its dependent on the cam position which (potentially) changes each frame. If you want to display a static scene / cam angle you could use an image with depth instead of a rendering of a scene I guess but again, it would require a special image format and shader. Thats why I guess in the end the actual applications do not amount to more than what you can achieve using a parallax and normal map. The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there's emotes that hint otherwise or there's an increased use of exclamation marks and all-capital words.
@normen said: As said its dependent on the cam position which (potentially) changes each frame. If you want to display a static scene / cam angle you could use an image with depth instead of a rendering of a scene I guess but again, it would require a special image format and shader. Thats why I guess in the end the actual applications do not amount to more than what you can achieve using a parallax and normal map.

Hmm, im not shure if we understand each other… lets say you have 7 pixels ­□□□■□□□ with □ a little bit inset in relation to ■. We assume the inset equals 1 pixels width/height. So thats a pixelroom in space effectively 7×1×2. Each pixel is already completely as xyz-defined (x/y from its position in the bitmap, z from its z-channel), it just has to get painted on screen, of course rotated and scaled according to camera angle.

Of course i /could/ layer this with – in that example 2 quads but the depth- resolution i’d like to get should be at least 20 so that would give me 20× the triangles for every textured plane im i’m correct on this?

Yeah, thats what a parallax map does. And you can edit and save it with photoshop.
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

Ok, so i move the Z-Channel into Normal-map-alpha, right? Is there a parameter i have to specify for this or does it scan for alpha in normal by default…?

A parallax map is a grayscale heightmap in most cases.
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

@normen said: A parallax map is a grayscale heightmap in most cases.

i mean NORMALMAP_PARALLAX … a preprocessor-directive. is the shader compiled for every texture according to the given maps and parameters or it is compiled once and for all … so, do i have to use different shaders for that (cp, rename, edt) or is this something i can provide as a texture- or material-parameter? Just added #define NORMALMAP_PARALLAX to lighting.frag, but it doesnt seem to change anything

That should be a normal map like others afaik but not what you describe.
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

in Lighting.frag, line 9 in this snipped, 116 in real code:
[java]
void main(){
vec2 newTexCoord;

#if defined(PARALLAXMAP) || defined(NORMALMAP_PARALLAX)
   float h;
   #ifdef PARALLAXMAP
      h = texture2D(m_ParallaxMap, texCoord).r;
   #else
      h = texture2D(m_NormalMap, texCoord).a;
   #endif
   float heightScale = 0.5;
   float heightBias = heightScale * -0.5;
   vec3 normView = normalize(vViewDir);
   h = (h * heightScale + heightBias) * normView.z;
   newTexCoord = texCoord + (h * -normView.xy);
#else
   newTexCoord = texCoord;
#endif

[/java]

Cant find anything about that in the phong lighting.j3md but there is that compiler-directive in the frag. something NYI or left-over? a simple #define NORMALMAP_PARALLAX at the start of the file doesnt do anything noticable.

Ok, its mat.setBoolean(“PackedNormalParallax”, true); but that still is just a quad when i look sideways. However, changing anything in vert or frag didnt do anything at all … do they have to be explicitly recompiled? if yes… how?

Well there you have the answer, in plain code. What is the problem? Does your parallax map not work?
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

@normen said: Well there you have the answer, in plain code. What is the problem? Does your parallax map not work?

Its rather the vert and frag that dont seem to be the real ones in use … i just erased any content and saved them as empty files an they still work… so … do i have to recompile them somehow?

I’ll repeat the question: What do you want to do and does the parallax map feature not work for you?
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.

@normen said: I'll repeat the question: What do you want to do and does the parallax map feature not work for you?

It kind-of works. it takes the x/y coordinate, calculates the height and parallaxely offsets the texture-coordinate. I’d like to do it the other way: take the height and offset the z-position. from what i know 'bout GLSL, this seems to be possible, but i’m not shure why my changes to the *.vert and *.frag-files dont do anything at all, even if i do something, that should result in fatal errors. the changes simply dont seem to get recompiled by the SDK.

So just use a normal grayscale parallax map like I say all the time…

@normen said: So just use a normal grayscale parallax map like I say all the time...

Look at the code, it doesnt matter if u use parallax map or normal-map with alpha. the result is the same: you dont offset the pixel, you offset the pixels tex-coordinate. i want to offset the pixel.