Problems with refraction/reflection

Problems with refraction/reflection

Postby SvenAndreasBelting » 01 Aug 2017, 22:25

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. :)
SvenAndreasBelting
 
Posts: 4
Joined: 01 Aug 2017, 20:45

Re: Problems with refraction/reflection

Postby Auria » 02 Aug 2017, 00:11

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
Image
User avatar
Auria
STK Moderator
 
Posts: 2799
Joined: 07 Dec 2009, 03:52

Re: Problems with refraction/reflection

Postby MTres19 » 02 Aug 2017, 00:49

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
User avatar
MTres19
 
Posts: 144
Joined: 17 Aug 2015, 20:15

Re: Problems with refraction/reflection

Postby SvenAndreasBelting » 03 Aug 2017, 13:07

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?
SvenAndreasBelting
 
Posts: 4
Joined: 01 Aug 2017, 20:45

Re: Problems with refraction/reflection

Postby MTres19 » 03 Aug 2017, 14:11

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.
User avatar
MTres19
 
Posts: 144
Joined: 17 Aug 2015, 20:15

Re: Problems with refraction/reflection

Postby Auria » 05 Aug 2017, 00:08

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
Image
User avatar
Auria
STK Moderator
 
Posts: 2799
Joined: 07 Dec 2009, 03:52

Re: Problems with refraction/reflection

Postby benau » 05 Aug 2017, 03:23

Try add a second uv in the object
benau
 
Posts: 44
Joined: 08 Dec 2015, 17:32

Re: Problems with refraction/reflection

Postby SvenAndreasBelting » 05 Aug 2017, 14:04

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?
SvenAndreasBelting
 
Posts: 4
Joined: 01 Aug 2017, 20:45

Re: Problems with refraction/reflection

Postby MTres19 » 05 Aug 2017, 15:02

No, you can upload the blend and any special textures to the forum here and we can export the track.
User avatar
MTres19
 
Posts: 144
Joined: 17 Aug 2015, 20:15

Re: Problems with refraction/reflection

Postby SvenAndreasBelting » 06 Aug 2017, 18:29

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.
SvenAndreasBelting
 
Posts: 4
Joined: 01 Aug 2017, 20:45

Re: Problems with refraction/reflection

Postby MTres19 » 19 Aug 2017, 14:09

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.
User avatar
MTres19
 
Posts: 144
Joined: 17 Aug 2015, 20:15

Who is online

Users browsing this forum: Bing [Bot] and 1 guest