Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 ... 4 5 [6]
  Print  
Author Topic: Zak's Ocean Shader Freely Downloadable [6.5]  (Read 149574 times)
rpiller
Community Member
*
Posts: 186


« Reply #100 on: August 27, 2007, 05:11:22 PM »

There is only one problem with this entire thing. The water looks so amazing it makes the landscape look bad Smiley When I start working on a game that needs water, I will for sure be looking into this little puppy. Create work indeed.
Logged
ZaPPZion
Moderator
Community Member
*****
Posts: 571


« Reply #101 on: September 07, 2007, 09:38:49 AM »

Hi,

I've got a couple questions now 6.5 is free to use (so i have it finally (no offence intended)). I'd like to use this water because it's awesome looking, but i've never worked with c++ or c#, but i can understand the language. If i'm not mistaken, only thing i need to port to VB6 is the water.cs file? And then i can make an instance of the class in vb, and use the methods that are inside?. (if zak agrees, and i succeed in porting it to vb6, i can probably post it on the wiki). Do you mind if i try to port it Zak?  Wink

thx in advantage.
Logged

Check out my website: www.bartkuipers.com
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #102 on: September 07, 2007, 10:09:15 AM »

Of course I don't mind! Smiley
It's open source, do what you want with it. But good luck porting that to VB6, I used some .NET-specific features like delegates, that may be harder to port. If you have questions/problems you can post them here... it'll help others that are trying to port.
Logged

ZaPPZion
Moderator
Community Member
*****
Posts: 571


« Reply #103 on: September 07, 2007, 11:11:37 AM »

oh yea, i see, didnt notice that stuff before Wink i'll try and find out if there's actually something like that in VB, or that it's just impossible to do this in VB (might be true, if so, i'll probably learn another language  Roll Eyes)
so it's just the water.cs right?
btw thx for the quick reply
Logged

Check out my website: www.bartkuipers.com
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #104 on: September 07, 2007, 11:39:12 AM »

Yep it should contain everything that's needed.
Logged

DarthSmiley
Community Member
*
Posts: 3


« Reply #105 on: December 18, 2007, 01:22:32 PM »

I started trying to convert this over to the latest 6.5 release, but i've run into a wall..

        Dim vec As TV3D65.TV_3DVECTOR
        Dim vec2 As TV3D65.TV_3DVECTOR
        Dim vec3 As TV3D65.TV_3DVECTOR

        vec = reflview.RowVec3(3)
        vec2 = vec + reflview.RowVec3(2)
        vec3 = vec + reflview.RowVec3(1)
        maths.TVPlaneFromPoints(comb, vec, vec2, vec3)
        maths.TVMatrixReflect(endreflect, comb)
        reflview = endreflect
It would seem that the RowVec3 class is no longer implemented.. What is one to do >_>
Logged
Hypnotron
Customers
Community Member
*****
Posts: 1050


« Reply #106 on: December 18, 2007, 01:39:33 PM »

perhaps something like...

Code:
public TV_3DVECTOR RowVec3(int rowID, TV_3DMATRIX mat)
{
if (rowID < 1  || rowID > 4) throw new ArgumentOutofRangeException();

TV_3DVECTOR row;
switch (rowID)
{
case 1:
row.x = mat.m11;
row.y = mat.m12;
row.z = mat.m13;
break;
case 2:
row.x = mat.m21;
row.y = mat.m22;
row.z = mat.m23;
break;
case 3:
row.x = mat.m31;
row.y = mat.m32;
row.z = mat.m33;
break;
case 4:
row.x = mat.m41;
row.y = mat.m42;
row.z = mat.m43;
break;
}

return row;
}
« Last Edit: December 18, 2007, 02:13:27 PM by Hypnotron » Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #107 on: December 18, 2007, 02:23:10 PM »

Uh, it's not a class and it's working right here.
It's a method under TV_3DMATRIX :
Code:
public TV_3DVECTOR RowVec3(int iIndex)
Logged

Hypnotron
Customers
Community Member
*****
Posts: 1050


« Reply #108 on: December 18, 2007, 02:39:00 PM »

always forget about these myself.
Logged
pvel
Community Member
*
Posts: 5


« Reply #109 on: January 28, 2008, 10:52:14 PM »

I'm having trouble getting this to work in my project...
I actually had decent looking water before, but this looks way better :-)
First, thx to Zak for opensourcing this.. Indie gamedev needs this kinda stuff to get things done :-P

I'm using C# for my project, and copied the Water class to my project.. I copied the initWater() method from your source, getting no errors in my debuglog.txt
but I'm not seeing any water. I also call water.render(); of course in my world.render() method.. My skybox works just fine, so it's not a central setting that's wrong.. I just don't see any water.. any suggestions would be more than welcome :-)
There is a lot of code in your example, and I'm having a bit of a hard time figuring out which I need. Seems you also have code for a landscape in it, which is no longer used?

Edit: hmm.. in your screenshots I do see the landscape. when I run your project, I don't see it.. Is that just me, or are the screenshots from an older version?
Logged
JohnB
Customers
Community Member
*****
Posts: 183


« Reply #110 on: January 28, 2008, 11:07:44 PM »

Are you sure you got all the shaders, textures, etc. copied to the right places?

Just an idea.

John B.
Logged
pvel
Community Member
*
Posts: 5


« Reply #111 on: January 28, 2008, 11:14:41 PM »

yep, edited all paths.. double checked them.
Also, errors like that should show up in debug output right?
Logged
pvel
Community Member
*
Posts: 5


« Reply #112 on: January 29, 2008, 12:50:22 AM »

Here's the source that matters I think, my World class:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using MTV3D65;
using System.Windows.Forms;

namespace game_v1
{
    internal class World
    {
        private Core core;

        private TVTextureFactory textureFactory;
        private TVLightEngine lights;
        private TVAtmosphere atmosphere;

        private Water water;

        public static readonly string PATH_SKYBOX = Core.PATH_MEDIA + @"Skybox\";

        public World(Core core)
        {
            this.core = core;

            textureFactory = new TVTextureFactory();
            lights = new TVLightEngine();
            atmosphere = new TVAtmosphere();
        }

        public void init()
        {
            initSkyBox();

            initWater();
        }

        private void initSkyBox()
        {
            int front, back, right, left, up, down;
            back = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_NegX.dds");
            down = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_NegY.dds");
            left = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_NegZ.dds");
            front = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_PosX.dds");
            up = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_PosY.dds");
            right = textureFactory.LoadTexture(PATH_SKYBOX + "Clouds_PosZ.dds");


            atmosphere.SkyBox_Enable(true);
            atmosphere.SkyBox_SetTexture(front, back, left, right, up, down);
            atmosphere.SkyBox_SetScale(5, 5, 5);
        }

        private void initWater()
        {
            #region SETTINGS

            TV_2DVECTOR NormalMapTiling = new TV_2DVECTOR(32, 32);
            int ReflectionSurfaceSquareSize = 384;
            Water.NormalMapMode NormalMapMode = Water.NormalMapMode.VolumeMap;
            String VolumeNormalMapTexturePath = "VolumeNormalMap.512.dds";
            String NormalMapTexturePath = "DualLookupNormalMap.512.VolumeSlice.dds";
            bool ParallaxMapping = true;
            bool DetailNormalMapping = true;
            bool TroubledWaterEnhancements = true;
            bool FoamSprays = true;
            bool LyonBlinnSpecularReflection = false;
            TV_COLOR skyAverageColor = new TV_COLOR(0.5f, 0.62f, 0.77f, 1);

            #endregion


            water = new Water(core, new TV_3DVECTOR(0, 40, 0), new TV_3DVECTOR(4096, 0, 4096), NormalMapTiling, ReflectionSurfaceSquareSize);

            int normalMapTexId;
            if(NormalMapMode == Water.NormalMapMode.VolumeMap)
                normalMapTexId = textureFactory.LoadVolumeTexture(Water.PATH_WATER + VolumeNormalMapTexturePath, "WaterNormalMap", CONST_TV_COLORKEY.TV_COLORKEY_USE_ALPHA_CHANNEL, true);
            else
                normalMapTexId = textureFactory.LoadTexture(Water.PATH_WATER + NormalMapTexturePath, "WaterNormalMap");


            water.Initialize(NormalMapMode, normalMapTexId, ParallaxMapping,
                DetailNormalMapping,TroubledWaterEnhancements,
                FoamSprays, LyonBlinnSpecularReflection);

            if(TroubledWaterEnhancements)
                water.SkyAverageColor = skyAverageColor;

            water.DistantRenderingMethod = RenderDistant;
            water.CloseRenderingMethod = RenderClose;
        }

        public void update()
        {
            water.update();
        }

        public void render()
        {
            RenderClose();
            RenderDistant();
            atmosphere.Atmosphere_Render();
            water.render();
        }

        public void postRender()
        {

        }

        public void RenderDistant()
        {
            atmosphere.Atmosphere_Render();
        }

        public void RenderClose()
        {
        }
    }
}

From what I can see, I'm doing exactly the same as the example source.. The skybox shows fine.. but no water to be found. Am I overlooking something obvious? :-/
Logged
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #113 on: October 31, 2008, 02:31:48 PM »

I’m translate Zaknafein's example on VB 6. But reflection doesn’t work. Somebody help…  Roll Eyes
"Does not work" can be anything... more details! Or would you like to get an error description a la "It won't work, because.. no dice!"
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
ZaPPZion
Moderator
Community Member
*****
Posts: 571


« Reply #114 on: November 01, 2008, 04:43:22 AM »

Does it give an error? does it reflect the wrong stuff? Does it display black? Does anything show up?
Logged

Check out my website: www.bartkuipers.com
Gamecode
Customers
Community Member
*****
Posts: 467


WWW
« Reply #115 on: November 02, 2008, 08:17:17 AM »

Reflections are absent.  Huh

Screenshots:
http://sergeyxp.narod.ru/screenshots.htm

hi,pls i have big problem make funcionaly watershader in VB6.
can u send me "tutorial" how to create zaks watershader funcionaly in vb6 ? pls !!
Logged

aiR Captains - RC aircraft project TV65
Pages: 1 ... 4 5 [6]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks