TGE water upgrade"-Ressource errors...
by Alex (Stalker) Sakablukow · in Torque Game Engine · 08/27/2006 (11:39 pm) · 7 replies
A great Ressource, but here are still a few errors...
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357
I have a error with the shader if player/camera is on a large distance (~200 meters) to the water surface..
It seems the shader dont work on a large distance, and render/use skybox instead? The blue quader that you can see was used for underwater bottom skybox texture.

the second error is that with a low view angle and a large distance the shader seems to dissapear near objects or terrain (anything with shadow maybe?)

Any idea about this?
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357
I have a error with the shader if player/camera is on a large distance (~200 meters) to the water surface..
It seems the shader dont work on a large distance, and render/use skybox instead? The blue quader that you can see was used for underwater bottom skybox texture.

the second error is that with a low view angle and a large distance the shader seems to dissapear near objects or terrain (anything with shadow maybe?)

Any idea about this?
#2
it seems as if a lot of the enhanced water stuff (reflections for example)
doesn't work right until you drop back into the game mode...
mabe that's it... i transformed myself up 400 and looked down while i was
falling, and everything seemed to look ok...
i mean, as far as i can see...
or did you go to god view and zoom up there... i did notice some
strangeness in free fly mode too...
--Mike
08/28/2006 (12:17 pm)
How did you get up that high Alex... in the editor...it seems as if a lot of the enhanced water stuff (reflections for example)
doesn't work right until you drop back into the game mode...
mabe that's it... i transformed myself up 400 and looked down while i was
falling, and everything seemed to look ok...
i mean, as far as i can see...
or did you go to god view and zoom up there... i did notice some
strangeness in free fly mode too...
--Mike
#3
08/28/2006 (1:04 pm)
Reflections are built into the playgui.gui. No real reason you can't copy that code into the editorgui as well.
#4
The error underwater was the same (bottom part was shown then), until i have implemented the changes from Trond Abusdal.
Bun now its still another reflection problem, and bots seems to be same.
But my code is heavy modificed, so it can be my own problem ;)
Can someone who has implemented this ressource test it with distances +-200m to water edge?
If i'm the only one who has this error, then i will probably check my own code ;)
08/28/2006 (11:31 pm)
@Michael Hense: i'm ingame with a free camera. Reflection works perfect until i get too high/deep from the water edge. On always same distance the reflection get broken, and show (probably) a part from Sky-Box (the blue quader on the first picture seems to be the top of my skybox).The error underwater was the same (bottom part was shown then), until i have implemented the changes from Trond Abusdal.
Bun now its still another reflection problem, and bots seems to be same.
But my code is heavy modificed, so it can be my own problem ;)
Can someone who has implemented this ressource test it with distances +-200m to water edge?
If i'm the only one who has this error, then i will probably check my own code ;)
#5
In sky.cc change the top of Sky::Render to look like this:
And at the bottom of the same function:
Next time, actually read through peoples post.
08/29/2006 (12:05 am)
You're not the only one that incounter this problem. This will Fix it. let me know how it goes.In sky.cc change the top of Sky::Render to look like this:
void Sky::render(SceneState *state)
{
PROFILE_START(SkyRender);
F32 banHeights[2] = {-(mSpherePt.z-1),-(mSpherePt.z-1)};
F32 alphaBan[2] = {0.0f, 0.0f};
F32 depthInFog = 0.0f;
Point3F camPos;
S32 index=0;
if(gClientSceneGraph)
{
F32 currentVisDis = gClientSceneGraph->getVisibleDistanceMod();
if(mLastVisDisMod != currentVisDis)
{
calcPoints();
for(S32 i = 0; i < MAX_NUM_LAYERS; ++i)
mCloudLayer[i].setPoints();
mLastVisDisMod = currentVisDis;
}
// krimzon - PRLD_WATER_SHADER
if (gClientSceneGraph->mReflectPass)
glDisable(GL_CLIP_PLANE0);
// -krimzon
}And at the bottom of the same function:
// krimzon - PRLD_WATER_SHADER
if (gClientSceneGraph)
{
if (gClientSceneGraph->mReflectPass)
glEnable(GL_CLIP_PLANE0);
}
// -krimzon
PROFILE_END();
}Next time, actually read through peoples post.
#6
About a month ago, I tried the fix you referred to. Unfortunately, it didn't solve the problem for me. It is very possible that Alex tried the same solution with similar results.
By the way, Alex is a professional developer ( www.vs-digital.com ) and has been very helpful to some of us on the forums (myself included). As far as I know he hasn't done anything to anyone to deserve snarky comments.
@Alex,
Even after applying the code fix to sky.cc, the only workaround I've found to the distance reflection problem was to raise my water block, terrain, and everything else by 100 units or so. It sounds strange, but it has worked pretty well for me.
08/29/2006 (6:15 am)
@T Squared,About a month ago, I tried the fix you referred to. Unfortunately, it didn't solve the problem for me. It is very possible that Alex tried the same solution with similar results.
By the way, Alex is a professional developer ( www.vs-digital.com ) and has been very helpful to some of us on the forums (myself included). As far as I know he hasn't done anything to anyone to deserve snarky comments.
@Alex,
Even after applying the code fix to sky.cc, the only workaround I've found to the distance reflection problem was to raise my water block, terrain, and everything else by 100 units or so. It sounds strange, but it has worked pretty well for me.
#7
With variables for the fog and water color integrated in the waterblock this is now on the point i have needed. :)
08/29/2006 (6:50 am)
Yes, have already found it, this was the one pice of code i have skipped.With variables for the fog and water color integrated in the waterblock this is now on the point i have needed. :)
Torque Owner Jon Jorajuria