Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Water From Demo; How can i make it veiwable from under
Topic Started: Nov 10 2007, 06:35 AM (664 Views)
Terror Doctrine
Member Avatar
Lead Programmer of Static
[ *  *  *  * ]
How can i make it so i can see the water when im underneath it?
Posted Image
Offline Profile Quote Post Goto Top
 
ashrat3000
Member Avatar
u3d raytracer
[ *  *  *  *  *  * ]
I've been having problems with this too. I tried making the refraction point up instead of down when you are below water level, but I think I did it wrong.
그대를 사랑해


Offline Profile Quote Post Goto Top
 
Terror Doctrine
Member Avatar
Lead Programmer of Static
[ *  *  *  * ]
Yes because at the mo it just looks like your in realy thick fog, you cant see the water level at all.
Posted Image
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
$pecter
 
When i needed an underwater shader (see here), I just used the 'fire and water' water shader, flipped the clipping planes,(
CODE
if camera.z+camera.height>water.z then SetClippingPlane(0,0,0,water.z-1,-90,0);
if camera.z+camera.height<water.z then SetClippingPlane(0,0,0,water.z+1,90,0);
)
and used fog.
Offline Profile Quote Post Goto Top
 
Terror Doctrine
Member Avatar
Lead Programmer of Static
[ *  *  *  * ]
Where does that code go?
Posted Image
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
I think it goes in the Refraction Camera.
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
Add these to their appropriate place.

Step Event of Reflection camera
Code:
 
if camera.z+camera.height>water.z then SetClippingPlane(0,0,0,water.z-1,-90,0);
if camera.z+camera.height<water.z then SetClippingPlane(0,0,0,water.z+1,90,0);

Step Event of Refraction camera
Code:
 
if camera.z+camera.height>water.z then SetClippingPlane(0,0,0,water.z+1,90,0);
if camera.z+camera.height<water.z then SetClippingPlane(0,0,0,water.z-1,-90,0);
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ok ive done it with pixel shader support, Ok for computers without pixel shader support how can i turn off backface culling for the model?
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
Open up the water model in anim8or duplicate it and flip the duplicates normals.
I made one for you.
link
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ahh ok thanks. :)
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Terror Doctrine
Member Avatar
Lead Programmer of Static
[ *  *  *  * ]
Ok i have to bring this topic up again because it is not working anymore. You cannot see the refraction of the sky and terrain from underneath. Im not sure what i done.

Here is my Code
Water Object
Code:
 

z=350;
x-=obj_island.tile_count_x*obj_island.tile_size*0.25;
y-=obj_island.tile_count_y*obj_island.tile_size*0.25;

if(GetSupportedPSVersion()>1.39){
   file='Data/Models/Water/Water_NPS.an8'
   LoadMesh();
   PS_Support=1
   SetMaterialStageTexture(0,0,1);
   SetMaterialStageTexture(0,1,5);
   SetMaterialStageTexture(0,2,3);
   SetMaterialStageTexture(0,3,1009);
   LoadMaterialEffect(0,'Effects/Water/Water.ufx');
   SetModelMaterial(0,0,140,140,255);
}
else{
file='Data/Models/Water/Water_NPS.an8'
LoadMesh();
PS_Support=0
SetModelMaterial(0,0,140,130,200);}


Reflection Camera (Create Event)
Code:
 
number=1;
view=90;
min_range=1;
max_range=2000;
actual_aspect=view_wport[0]/view_hport[0]
if(GetSupportedPSVersion()<=1.39){
instance_destroy();}
CreateTextureRenderTarget(1,global.u3d_reflection_detail,
global.u3d_reflection_detail);
render_target=1;
v_width=global.u3d_reflection_detail;
v_height=global.u3d_reflection_detail;
MoveCamera();


Reflection Camera (Step Event)
Code:
 
if Camera.z+Camera.height>Sea_Engine.z then SetClippingPlane(0,0,0,Sea_Engine.z-4,-90,0);
if Camera.z+Camera.height<Sea_Engine.z then SetClippingPlane(0,0,0,Sea_Engine.z+4,90,0);
//SetClippingPlane(0,0,0,Sea_Engine.z-1,-90,0);
roty=Camera.roty;
rotx=-Camera.rotx;
x=Camera.x;
y=Camera.y;
z=2*Sea_Engine.z-Camera.z-Camera.height;
MoveCamera();
RenderToTexture();


Refraction Camera (Create Event)
Code:
 
number=2;
view=90;
min_range=1;
max_range=2000;
actual_aspect=view_wport[0]/view_hport[0];
if(GetSupportedPSVersion()<=1.39){
instance_destroy();}

CreateTextureRenderTarget(3,global.u3d_refraction_detail,
global.u3d_refraction_detail);

render_target=3;
v_width=global.u3d_refraction_detail;
v_height=global.u3d_refraction_detail;
MoveCamera();


Refraction Camera (Step Event)
Code:
 
if Camera.z+Camera.height>Sea_Engine.z then SetClippingPlane(0,0,0,Sea_Engine.z+4,90,0);
if Camera.z+Camera.height<Sea_Engine.z then SetClippingPlane(0,0,0,Sea_Engine.z-4,-90,0);
//SetClippingPlane(0,0,0,Sea_Engine.z+1,90,0);
rotx=Camera.rotx;
roty=Camera.roty;
x=Camera.x;
y=Camera.y;
z=Camera.z+Camera.height;
MoveCamera();

with(Sea_Engine){
   SetObjectRoom(1);
}
RenderToTexture();
with(Sea_Engine){
   SetObjectRoom(0);
}
Posted Image
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Maybe you didn't set the visibility state of rooms 0 and 1, because I don't see any calls to SetRoomVisibility(...) in your code?
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
He told me it works fine from above but nothing is still visible from below.
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ok instead of making another water topic ill ask here, How can i make the distortion map repeat. Because the larger i make my water the larger and more pixelaled the refractions become.
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
alexw
Member Avatar
Advanced Member
[ *  *  * ]
Why dont you make an water object?
Its more realistic do.

Alexw
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply