Page 1 of 1

Problems with refraction/reflection

PostPosted: 01 Aug 2017, 22:25
by SvenAndreasBelting
I have a problem in creating water. Whenever I set the object properties on refraction/reflection, the selected object is not displayed in SuperTuxKart and also no light is reflected. The object is physically present (as you cannot drive through, while object property is set on "static") but not visible.

I have tried really hard, but still not found any solution for this problem. The exporter should work well because for testing I managed to export the "Mine track" and everything was displayed correctly (reflecting water). After that I did rebuild the water in my track just exactly as it is done in the "Mine track" (same textures, same image properties, same object properties) but again, it didn't work.
Bildschirmfoto vom 2017-08-01 20-51-46.jpg
Here you can see the object properties from the upper plane. (the plane below is a reset-plane.)


Bildschirmfoto vom 2017-08-01 20-52-41.jpg
Here you can see the image properties from the texture (also upper plane)


Bildschirmfoto vom 2017-08-01 20-58-32.jpg
Here you can see the image properties of the texture (lower plane). object properties for this lower plane are: "none"


Bildschirmfoto vom 2017-08-01 20-56-43.jpg
Here you see the resultant image as it is displayed in SuperTuxKart: The water is not visible.


Bildschirmfoto vom 2017-08-01 21-14-44.jpg
Here you can see the result displayed in SuperTuxKart when the object property "refraction/reflection" is not activated.


Thank you very much for helping me. :)

Re: Problems with refraction/reflection

PostPosted: 02 Aug 2017, 00:11
by Auria
Hi,

this option might not be clearly documented, agreed. It probably does not do what you expect : this is a shader that simulates water by making anything behing it "wavy", the selected mesh will however not itself be visible, it is only there to mark the boundaries of the effect. You can see the effect in the subsea track, looking at the walls. So what you could do is have the water mesh without this effect, and add a second mesh slightly above it with this effect

Re: Problems with refraction/reflection

PostPosted: 02 Aug 2017, 00:49
by MTres19
If you open ancestral_abyss-04.blend in the tracks/20_ancestral_abyss folder of the media repo, make the object Circle.002 visible in the outliner window, and disable backface culling, you can see how it's done in blender. The texture that says "disp" on it it is completely optional.
Screenshot_20170801_194452.png

Re: Problems with refraction/reflection

PostPosted: 03 Aug 2017, 13:07
by SvenAndreasBelting
Thank you for your answers.

So I have tried, what Auria has suggested: I have duplicated the water mesh, put one of them a bit higher, and I activated the object property "refraction/reflection" only for the upper mesh. It still doesn't work. :cry:

Bildschirmfoto vom 2017-08-03 13-47-11.jpg
These are the three meshes. The top mesh with object property "refraction/reflection", the middle one without this, but only with the texture of water, the bottom mesh for resetting the karts.


The result in SuperTuxKart looks the same as there would be no mesh with refraction/reflection. It looks just like my screenshot no. 5 from the post on 1. of August.

Is there anything else I should have activated to be successful?

Re: Problems with refraction/reflection

PostPosted: 03 Aug 2017, 14:11
by MTres19
I think you should actually be using a transparent texture, contrary to what Auria said. Do you have the media repository checked out? If so, texture your mesh with gfx_distord_AlphaTest.png from the textures/gfx folder. When you load the track in the game, it will load the version of that texture in stk-assets, which is just a transparent texture. Make sure not to copy the gfx_distord_AlphaTest.png file to the folder containing your track.

Re: Problems with refraction/reflection

PostPosted: 05 Aug 2017, 00:08
by Auria
also, if that does not work, please upload the blend and the exported track so that we can download it and take a look, it's much easier than trying to guess from screenshots

Re: Problems with refraction/reflection

PostPosted: 05 Aug 2017, 03:23
by benau
Try add a second uv in the object

Re: Problems with refraction/reflection

PostPosted: 05 Aug 2017, 14:04
by SvenAndreasBelting
Auria {l Wrote}:also, if that does not work, please upload the blend and the exported track so that we can download it and take a look, it's much easier than trying to guess from screenshots

you mean upload both (blend and track) as add-on on STK?

Re: Problems with refraction/reflection

PostPosted: 05 Aug 2017, 15:02
by MTres19
No, you can upload the blend and any special textures to the forum here and we can export the track.

Re: Problems with refraction/reflection

PostPosted: 06 Aug 2017, 18:29
by SvenAndreasBelting
benau {l Wrote}:Try add a second uv in the object

That's it!
Now it's finally working. :D :)

Thank you very much for your help, everybody.
And thank you, benau, for the tip with the two uv maps.

I try to finish and publish the track soon.

Re: Problems with refraction/reflection

PostPosted: 19 Aug 2017, 14:09
by MTres19
By the way, Benau fixed this quirk in the latest code, so if you run the git version or wait until the next release or release candidate you'll no longer have this problem. However, two uv maps shouldn't cause a problem.

Re: Problems with refraction/reflection

PostPosted: 31 Aug 2017, 03:41
by QwertyChouskie
Can you tell me where you got the whale model?

Re: Problems with refraction/reflection

PostPosted: 31 Aug 2017, 17:01
by SvenAndreasBelting
I got it from the stk_media_repo_090, namely from the old subsea track.
I do not know if the old subsea track is still contained in the new media repo.

Re: Problems with refraction/reflection

PostPosted: 02 Sep 2017, 21:31
by SvenAndreasBelting
Now, I have uploaded the source file. There you can find the whale model as well.

Re: Problems with refraction/reflection

PostPosted: 04 Sep 2017, 20:34
by Arthur
SvenAndreasBelting {l Wrote}:I got it from the stk_media_repo_090, namely from the old subsea track.
I do not know if the old subsea track is still contained in the new media repo.

If you want older tracks you can just browse the history. Here I've used r16000 as an example:
https://sourceforge.net/p/supertuxkart/ ... edia/trunk
just edit the revision number and you're good to go. :)

Re: Problems with refraction/reflection

PostPosted: 08 Sep 2017, 23:10
by Ludsky
Your track is sooooo wonderful, Very good job :)

But possible to add barriers, in some places, karts fall :/