Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
   Copyright (c) 2018 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _WATER_PLANE_H_
#define _WATER_PLANE_H_

#include "Geometry/Shapes/Headers/Object3D.h"
#include "Geometry/Shapes/Predefined/Headers/Quad3D.h"
#include "Platform/Video/Buffers/RenderTarget/Headers/RenderTarget.h"

namespace Divide {

class Texture;
class ShaderProgram;

class WaterPlane : public SceneNode {
   public:
    explicit WaterPlane(ResourceCache& parentCache, size_t descriptorHash, const stringImpl& name, const vec3<F32>& dimenions);
    ~WaterPlane();

    /// Resource inherited "unload"
    bool unload() override;
    /// General SceneNode stuff
    bool onRender(SceneGraphNode& sgn,
                  const SceneRenderState& sceneRenderState,
                  const RenderStagePass& renderStagePass) override;

    bool pointUnderwater(const SceneGraphNode& sgn, const vec3<F32>& point);

    inline const std::shared_ptr<Quad3D>& getQuad() const { return _plane; }

    void updatePlaneEquation(const SceneGraphNode& sgn,
                             Plane<F32>& plane,
                             bool reflection);

    // width, length, depth
    const vec3<F32>& getDimensions() const;

   protected:
    void buildDrawCommands(SceneGraphNode& sgn,
                                const RenderStagePass& renderStagePass,
                                RenderPackage& pkgInOut) override;

    void postLoad(SceneGraphNode& sgn) override;

   private:
    void updateBoundsInternal(SceneGraphNode& sgn) override;
    void updateReflection(RenderCbkParams& renderParams, GFX::CommandBuffer& bufferInOut);
    void updateRefraction(RenderCbkParams& renderParams, GFX::CommandBuffer& bufferInOut);

   private:
    /// cached far plane value
    vec3<F32> _dimensions;
    /// the water's "geometry"
    std::shared_ptr<Quad3D> _plane;

    Camera* _reflectionCam;
};

TYPEDEF_SMART_POINTERS_FOR_CLASS(WaterPlane);

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Environment/Water/Headers/Water.h

Diff revisions: vs.
Revision Author Commited Message
1029 Diff Diff IonutCava picture IonutCava Tue 30 Jan, 2018 17:28:39 +0000

[Ionut]
- Update copyright notices

950 Diff Diff IonutCava picture IonutCava Sun 22 Oct, 2017 22:25:05 +0000

[Ionut]
- Revamp camera management
- More work on improving the command buffer system:
— Performance tweaks
— Validation
— Debug features
- Some code cleanup for Object3D stuff (preRender/onRender changes)

Still haven’t fixed random flashing issue

948 Diff Diff IonutCava picture IonutCava Tue 17 Oct, 2017 22:41:09 +0000

[Ionut]
- Move rendering data caching outside of CommandBuffer and into RenderPackage for better control.

933 Diff Diff IonutCava picture IonutCava Tue 15 Aug, 2017 00:02:05 +0000

[Ionut]
- CommandBuffer Part 2/3: code compiles and splash screen renders and application doesn’t crash (still has drawing issues)

929 Diff Diff IonutCava picture IonutCava Sat 12 Aug, 2017 17:34:44 +0000

[Ionut]
- More work on finishing up new PushConstant / Command buffer rendering system:
— Everything compiles and runs but with graphical and performance issues

886 Diff Diff IonutCava picture IonutCava Wed 29 Mar, 2017 23:36:51 +0000

[Ionut]
- Initial code for multiple water block support (position + length/width/depth)

863 Diff Diff IonutCava picture IonutCava Wed 15 Feb, 2017 16:27:26 +0000

[IonutCava]
- Split Resource class into Resource and CachedResource
— CachedResource is the only resource held in a ResourceCache and loaded from a ResourceDescriptor
— CachedResource is mapped by its creation descriptor’s hash value, instead of the resource name
-— Multiple cached resources can now exist with the same name if the have different properties, for example.

852 Diff Diff IonutCava picture IonutCava Tue 07 Feb, 2017 17:17:27 +0000

[IonutCava]
- Separate Pass Type from Render Stage:
— Render Stage: Display, Shadow, Reflection, Refraction, etc
— Pass Type: Depth pass, Colour Pass, etc
- ToDo: Bug fixes for issues introduced with this change

851 Diff Diff IonutCava picture IonutCava Mon 06 Feb, 2017 23:38:14 +0000

[IonutCava]
- Replaced most RenderStage params with RenderStagePass types
- More work on water rendering

850 IonutCava picture IonutCava Mon 06 Feb, 2017 17:04:39 +0000

[IonutCava]
- More code rot fixes
- Separate Planar reflectors/refractors from Cube R/R
- Now passing detail levels to shaders