parallax issue

Posted By: mireazma

parallax issue - 07/01/11 22:34

Hello.
i need a parallax shader that would work in my case (you'll see further). I know next to nothing about creating a shader (though I read the tut). Don't want to be picky but the default one is way too off. Maybe it's some parameter I'm missing. I tried those sliders under parallax spec box but wouldn't do anything.
Anyway, if I'm not asking for too much, would anyone be so kind to direct me to a good parallax shader? By good I mean "correct". In this particular case of mine I'd also need a little more relief, the effect to be more outstanding, sticking out, you got it :D, so the wheels are wider. Here are some screenies about the default parallax effect -- judge it for yourselves:

If nobody knows of such a shader, I'd take the hard way and modify the default one (God knows what I'd have to edit, it looks spooky, lol) so at least tell me what exactly I'm supposed to change.
Posted By: painkiller

Re: parallax issue - 07/01/11 23:14

parallax shader needs plane surfaces, for curved shapes use bump
Posted By: mireazma

Re: parallax issue - 07/02/11 16:00

Thanks, painkiller but I only have flat surfaces (2D). It's the particular shader that's... not right.
Posted By: mireazma

Re: parallax issue - 07/04/11 14:50

what's my track different from a simple box, this is what I don't understand. Do you find the rendering above satisfying?
Here is how xNormal parallax looks like:


The wheels literally stand out from the background in the right direction, according to camera, not to mention the bump lighting on the wheels.
The diffuse texture is not the same but it doesn't matter anyway. It's a geometry issue.
Sometimes areas of wheels are cropped and gaps between the wheels can be seen but I couldn't ask for more from parallax -- it's not real geometry.
Posted By: JibbSmart

Re: parallax issue - 07/04/11 14:59

It's not the shader that's wrong (well it might be, but that's not your problem so far). Yes, you only have flat surfaces, but polygons are always flat. Look at the smooth lighting on your tracks. That's because the vertices are all welded together. Normals get interpolated between vertices to make things smooth.

You want flat-shading, and to do this you need hard edges between each flat surface. And to do that, you need to detach them from each other. And to do that in MED you want to copy a flat surface, delete it, then paste it (it will have the right position, but not be attached to the surfaces around it).

Jibb
Posted By: painkiller

Re: parallax issue - 07/04/11 15:24

or you can also separate faces in different groups
Posted By: Pappenheimer

Re: parallax issue - 07/04/11 15:56

Originally Posted By: painkiller
or you can also separate faces in different groups

And does this work, even when the faces are still connected?
Posted By: painkiller

Re: parallax issue - 07/04/11 16:40

when you separate them in different groups the vertices are also separated, I've done that many times
Posted By: mireazma

Re: parallax issue - 07/04/11 17:01

Now you guys have lost me completely. Either I don't get you, or the other way around. If I'm wrong (in fact, in either case) then please bear with me a little more and enlighten me. So:

I have a simple 8 sided box with diffuse, normal and height textures. That's my track.
In xNormal it looks just fine. But unfortunately I can't get that shader.
In A8 the direction in which the white "high" areas in the height map (wheels) are projected is almost the opposite to as it should be. The angle is my main problem (1) and that the wheels don't get lit as they are in xNormal (as deserved grin).
Maybe you (JibbSmart) are talking about the different sides of the model, like top, side, under etc. Then I don't see how the edges between these faces would matter. I don't know of any other edges.
Posted By: JibbSmart

Re: parallax issue - 07/04/11 17:42

Yes, those are the edges I'm talking about. And they do matter, because you want the parallax shader to treat the faces as flat surfaces, but they won't get treated that way unless they are separated from the other surfaces. See the smooth shading in your screenshots? That's because they're connected. You don't want that in this circumstance.

If they're being projected in the reverse (it's hard to tell from your screenshots), try inverting the height map. I've never used the built-in parallax shader, so I can't really give you much information about how it works.

Jibb
Posted By: mireazma

Re: parallax issue - 07/04/11 22:47

Ok. I've run the shader test like 10 times and I did what JibbSmart and painkiller said about isolating the faces. Now I get what Jibb meant about the smooth shades. They vanished after the isolation. The lighting looks pretty good now. In fact, it would be perfect, better yet than xNormal, if it weren't for the darn direction.
After intensively rotating the object in every possible way and position, I came to notice that the parallax left-right scrolling corresponds to tilting instead of panning and vice-versa -- when panning the object, the texture is scrolled vertically.
I took a look inside the .fx and I understand about 10%. I discovered where to edit the strength of the effect but I can't locate the pan and tilt thing, no matter what.
Posted By: mireazma

Re: parallax issue - 07/08/11 01:34

I took the time to study shaders in the past few days and I figured out what to modify in 3DGS default parallax shader. I changed a couple of things in there and it straightened quite a bit. I swapped x and y for the view in tangent space and inverted the heightmap interpretation but it's still buggy:

As you can see, the offsetting looks a little rotated and wobbly (?!). Notice the road wheels, also the narrowing along the bottom of the track and the little wheels from the top.
Would somebody give me a hand, please? Making games was supposed to be fun (well generally, except for making money which is not my case) but frustration took over for the last week because I encountered a problem which letting aside I'm not responsible of, but it's damn hard to correct. So, if somebody would be kind to tell me how is it working on your PC, or if you have a better parallax shader to give away or an idea but the one to let go of parallax.
Posted By: mireazma

Re: parallax issue - 07/18/11 21:48

Another 10 days have past without any solution whatsoever. I couldn't find a working HLSL parallax shader, nor could get to the bottom of the one built-in.
What's up with this mystery around the parallax shader? It's like some tabu thing that makes everybody uncomfortable. I really don't get it.

Anybody who knows shaders or really anybody at all, can help me get out of this one?

© 2024 lite-C Forums