Skip to content

Commit ae3adb3

Browse files
committed
Implement core functions of perlin noise
1 parent cc69ad0 commit ae3adb3

35 files changed

+398
-227
lines changed

CMakeLists.txt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required (VERSION 3.6 FATAL_ERROR)
22

33
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
4-
project (FRSML)
4+
project (frsml)
55

66
set(CMAKE_CXX_STANDARD 14)
77

@@ -10,10 +10,6 @@ include (ComplierTarget)
1010
set (FRSML_VERSION_MAJOR_PUBLIC 3)
1111
set (FRSML_VERSION_MINOR_PUBLIC 0)
1212

13-
configure_file(
14-
"${PROJECT_SOURCE_DIR}/include/frsml/config.h.in"
15-
"${PROJECT_BINARY_DIR}/include/frsml/config.h")
16-
1713
if (MSVC)
1814
detect_architecture("_M_AMD64" x86_64)
1915
detect_architecture("_M_IX86" x86)
@@ -30,13 +26,29 @@ if (NOT DEFINED ARCHITECTURE)
3026
add_definitions(-DARCHITECTURE_GENERIC = 1)
3127
endif()
3228

33-
option(DYNAMIC_FRSML OFF)
29+
option(DYNAMIC_FRSML ON)
30+
option(SSE_FRSML ON)
31+
option(AVX_FRSML OFF)
32+
option(NEON_FRSML OFF)
3433

3534
if (DEFINED DYNAMIC_FRSML)
36-
add_definitions(-DFRSML_DYNAMIC)
35+
set(FRSML_DYNAMIC 1)
36+
set(FRSML_DYNAMIC_EXPORTS 1)
37+
endif()
38+
39+
if (DEFINED SSE_FRSML)
40+
add_definitions(-DFRSML_SSE)
41+
elseif (DEFINED NEON_FRSML)
42+
add_definitions(-DFRSML_NEON)
43+
else ()
44+
add_definitions(-DFRSML_NORMAL)
3745
endif()
3846

3947
message(STATUS "The target architure going to is: ${ARCHITECTURE}")
4048

49+
configure_file(
50+
"${PROJECT_SOURCE_DIR}/include/frsml/config.h.in"
51+
"${PROJECT_SOURCE_DIR}/include/frsml/config.h")
52+
4153
include_directories(include)
4254
add_subdirectory (src)

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ A small linear math library using SSE4.
44

55
## What is FRSML
66

7-
+ FRSML (FranceSnack Math Library) is a project which targets Vulkan developers (so do I). The library does some linear math, and contains basic class for linear math like Vector3, Matrix4, Quaternion, and so on. All the math are done in SSE4.2, which I can confirm that my library would support Linux and Windows platform. In the feauture, the project may implement a easy way for devs to buffering indices, vertices, ... The library gets to the point where it stable now, but not so good, since many feautures i dream for haven't still been implemented.
7+
- FRSML (FranceSnack Math Library) is a project which targets Vulkan developers
8+
- The library does some linear math, and contains basic class for linear math like vec3,mat4,quat with fast optimizations.
9+
- Works cross-platform
810

9-
**************************
1011

1112
## Build project:
1213

1314
+ Windows: Using solutions provied
1415
+ Unix: Clone and build the project using CMake and your favorite compiler.
1516

16-
**************************
17-
1817
## Using the library
1918

20-
+ Link the library with the project you like, and take all the headers in the include folder to work with.
21-
+ Detail:
22-
- Compile the project and link the library with the porject you want.
23-
- You can compile the library as static or dynamic.
19+
- Now you can compile the library dynamiclly or static.
20+
+ Compiler will produce two libraries: Once implements specific optimization, once is wrapper
21+
+ For example: if you choose FRSML_SSE and dynamiclly build, compiler will produce *frsml_sse.dll* and *frsml.dll*
22+
+ But you only have to link frsml.dll to use in your project (frsml_sse is depency)
23+
24+
- Please include the headers in the include/frsml folder
2425

File renamed without changes.

changelog.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
1-
# FRSML 3.1 Milestone
2-
- Add noise functions: Simplex, Perlin (1d,2d,3d)
3-
- Add mat2 and mat3
4-
- Smooth damp implementation
5-
- Implement AVX and NEON optimizations
1+
# FRSML 3.1 Milestone: 3.33% / 100
2+
- Add noise functions: 11.1% - Map = 3.33/30%
3+
+ Simplex Noise: 0% (Resources?)
4+
+ Perlin (1d,2d,3d): 60% - Map = 11.1%/33.3%
5+
* Gradient functions: 10/10%
6+
. SSE: 5/5%
7+
. Norm: 5/5%
8+
* Perlin 3D Functions: 50/50%
9+
. SSE: 25/25%
10+
. Norm: 25/25%
11+
* Perlin 1D, 2D Wrapper: 0/10%
12+
. SSE: 0%
13+
. Norm: 0%
14+
* Interfaces: 0/5%
15+
* Seed to permutations: 0%/25% (PNG incomplete)
16+
+ Octawaves: 0% (Perlin incompleted)
17+
- Add mat2 and mat3 - 0% - Map = 0%/5%
18+
- Fast pseudo number generator - 0% - Map = /10%
19+
- Smooth damp implementation - 0% - Map = / 5%
20+
- Implement NEON optimizations - 0% - Map = / 50%
21+
22+
# FRSML 3.0.3 - 31/1/2018 10:51PM
23+
- Correct the lerp, sin functions
24+
- Add fade function
25+
- Now you can use some functions of the library without optimizations
26+
+ To do that, build the project without ticking any optimization option.
27+
- Now you can compile the library dynamiclly or static.
28+
+ Compiler will produce two libraries: Once implements specific optimization, once is wrapper
29+
+ For example: if you choose FRSML_SSE and dynamiclly build, compiler will produce *frsml_sse.dll* and *frsml.dll*
30+
+ But you only have to link frsml.dll to use in your project (frsml_sse is depency)
631

7-
# FRSML 3.0.2
32+
# FRSML 3.0.2 - 30/1/2018 6:00PM
833
- Last time origanized the header
934

1035
# THE NEW FRSML 3.0
1136
- Still compatible with Vulkan and OpenGL, but some new class is in
1237
+ Add a Rectangle and Point struct
13-
+ Fixing issues with Matrix4 about the multiplying
14-
- Clean the project, rename namespace to lowercase for compatible writing code
38+
+ Fix issues with Matrix4 about the multiplying
39+
- Clean the project, rename namespace to lowercase
1540
- Merge the struct to single file
1641
- Remove the PASCAL version
1742

@@ -27,7 +52,7 @@
2752

2853
Working now : ->-
2954

30-
![alt tag](https://raw.githubusercontent.com/bentokun/FRSML/master/result_vk.png)
55+
![alt tag](https://raw.githubusercontent.com/bentokun/FRSML/master/RESULT.png)
3156

3257
## UPDATE:
3358

@@ -63,8 +88,6 @@
6388
- Will it take the rows or cols value: I dont even know? It's poorly documented
6489
- Therefore, i put the cols value public. ~~When i test the uniform (which i lost my precious time because of the math library throw exception that took 5 hours to figure out the error that make fstream fck failed), i will dive into it and can edit the struct.~~ Confirm that it take the public value first.
6590
66-
67-
* Also, MSVS 2017 has a really nice logo! ^_^
6891

6992
### 15/4/2017 ................
7093

include/frsml/config.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
#pragma once
1+
#define FRSML_MAJOR_VERSION_PUBLIC 3
2+
#define FRSML_MINOR_VERSION_PUBLIC 0
3+
4+
#define FRSML_DYNAMIC
5+
#define FRSML_DYNAMIC_EXPORTS
6+

include/frsml/config.h.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#define FRSML_MAJOR_VERSION_PUBLIC @FRSML_VERSION_MAJOR_PUBLIC@
22
#define FRSML_MINOR_VERSION_PUBLIC @FRSML_VERSION_MINOR_PUBLIC@
33

4-
#cmakedefine INCLUDE_CPUID
5-
#cmakedefine USE_DECREPATED
4+
#cmakedefine FRSML_DYNAMIC
5+
#cmakedefine FRSML_DYNAMIC_EXPORTS
6+

include/frsml/internal.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#ifndef FRSML_INTERNAL_H
22
#define FRSML_INTERNAL_H
33

4+
#ifndef FRSML_CONFIG_H
5+
#define FRSML_CONFIG_H
6+
7+
#include "config.h"
8+
9+
#endif
10+
411
typedef unsigned char u8;
512
typedef unsigned short u16;
613
typedef unsigned int u32;
@@ -25,8 +32,8 @@ typedef unsigned int size32;
2532
#define PISQ 9.86960440108935861883449099987615114f
2633

2734
#ifdef _WIN32
28-
#ifdef FRS_DYNAMIC
29-
#ifdef FRS_DYNAMIC_EXPORT
35+
#ifdef FRSML_DYNAMIC
36+
#ifdef FRSML_DYNAMIC_EXPORTS
3037
#define FRS_MATH_API __declspec(dllexport)
3138
#else
3239
#define FRS_MATH_API __declspec(dllimport)

include/frsml/matrix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef FRSML_MATRIX_H
22
#define FRSML_MATRIX_H
33

4-
#include <frsml/internal.h>
5-
#include <frsml/vector.h>
4+
#include "internal.h"
5+
#include "vector.h"
66

77
namespace frsml {
88

include/frsml/noise.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef FRSML_NOISE_H
22
#define FRSML_NOISE_H
33

4-
#include <frsml/internal.h>
4+
#include "internal.h"
55

66
namespace frsml {
7-
float perlin(float x, float y, float z, const char* seed);
7+
float FRS_MATH_API perlin(float x, float y, float z, const char* seed);
88
}
99

1010
#endif

include/frsml/point.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef FRSML_POINT_H
22
#define FRSML_POINT_H
33

4-
#include <frsml/internal.h>
4+
#include "internal.h"
55

66
namespace frsml {
77
struct FRS_MATH_API point {

0 commit comments

Comments
 (0)