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
#include "stdafx.h"

#include "Headers/ParticleColourGenerator.h"

namespace Divide {

void ParticleColourGenerator::generate(TaskHandle& packagedTasksParent,
                                      const U64 deltaTimeUS,
                                      ParticleData& p,
                                      U32 startIndex,
                                      U32 endIndex) {

    const FColour minStartCol(Util::ToFloatColour(_minStartCol));
    const FColour maxStartCol(Util::ToFloatColour(_maxStartCol));
    const FColour minEndCol(Util::ToFloatColour(_minEndCol));
    const FColour maxEndCol(Util::ToFloatColour(_maxEndCol));

    TaskPool& tp = packagedTasksParent._task->getOwningPool();

    typedef decltype(std::begin(p._startColour)) iter_t_start;
    typedef decltype(std::begin(p._endColour)) iter_t_end;
    for_each_interval<iter_t_start>(std::begin(p._startColour) + startIndex,
                                    std::begin(p._startColour) + endIndex,
                                    ParticleData::g_threadPartitionSize,
                                    [&](iter_t_start from, iter_t_start to)
    {
        packagedTasksParent.addChildTask(CreateTask(tp,
            [from, to, minStartCol, maxStartCol](const Task& parentTask) {
                std::for_each(from, to, [&](iter_t_start::value_type& colour)
                {
                    colour.set(Random(minStartCol, maxStartCol));
                });
            }))->startTask(Task::TaskPriority::HIGH);
    });

    for_each_interval<iter_t_end>(std::begin(p._endColour) + startIndex,
                                  std::begin(p._endColour) + endIndex,
                                  ParticleData::g_threadPartitionSize,
                                  [&](iter_t_end from, iter_t_end to)
    {
        packagedTasksParent.addChildTask(CreateTask(tp,
            [from, to, minEndCol, maxEndCol](const Task& parentTask) {
                std::for_each(from, to, [&](iter_t_end::value_type& colour)
                {
                    colour.set(Random(minEndCol, maxEndCol));
                });
            }))->startTask(Task::TaskPriority::HIGH);
    });
}
};

Commits for Divide-Framework/trunk/Source Code/Dynamics/Entities/Particles/ConcreteGenerators/ParticleColourGenerator.cpp

Diff revisions: vs.
Revision Author Commited Message
1004 Diff Diff IonutCava picture IonutCava Wed 20 Dec, 2017 17:16:32 +0000

[Ionut]
- More GUI cleanup (added multiple GUIButton events)
- Typedef vec4<U8> and vec4<F32> to UColour and FColour respectively for easier to read code.

968 Diff Diff IonutCava picture IonutCava Tue 07 Nov, 2017 17:32:31 +0000

[Ionut]
- Consistent naming between timing variables

943 Diff Diff IonutCava picture IonutCava Tue 12 Sep, 2017 11:38:52 +0000

[IonutCava]
- Rework ThreadPool/Task system for clearer parent<->child relationship between tasks
— Disable Prio pool since it doesn’t work properly with the newest boost libraries
— Modify the C++11 threadpool to remove the boost dependency
- Reduce memory usage by allocating command buffers on use instead of on creation

890 Diff Diff IonutCava picture IonutCava Sun 14 May, 2017 20:54:59 +0000

[Ionut]
- Add pre-compiled header support
- Initial code for per-stage tessellation computation

811 Diff Diff IonutCava picture IonutCava Wed 11 Jan, 2017 17:26:49 +0000

[IonutCava]
- Fix some threadpool cleanup bugs
- Fix terrain rendering (except underwater caustics)
- Fix terrain loading
- Fix terrain unloading

799 Diff Diff IonutCava picture IonutCava Thu 24 Nov, 2016 22:55:23 +0000

[IonutCava]
- Performance analysis guided optimizations.

721 IonutCava picture IonutCava Wed 08 Jun, 2016 15:47:49 +0000

[IonutCava]
- Spelling: change all references from our code of “color” to the PROPER British version of “colour” because it sounds 100x better