Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified packs/Angryfly.pack
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/License.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ The AngryFly pack is only to be distributed as a whole, without modifications wi
As the files build up to the pack are licensed under the "Royalty-Free-License" from TurboSquid. So no other redistrubution, or reverse engineering of the pack files is allowed.
See: http://support.turbosquid.com/entries/31030006-Royalty-Free-License

The msgamedev pack is only to be distributed as a whole, without modifications with copies of EmptyEpsilon.
The msgamedev packs, msgamedev-1.pack and msgamedev-2.pack, are only to be distributed together as a whole, without modifications with copies of EmptyEpsilon.

As the files build up to the pack are licensed under the licence from cgtrader. So no other redistrubution, or reverse engineering of the pack files is allowed.
Binary file added packs/msgamedev-1.pack
Binary file not shown.
Binary file renamed packs/msgamedev.pack → packs/msgamedev-2.pack
Binary file not shown.
82 changes: 0 additions & 82 deletions packs/pack_gen.py

This file was deleted.

19 changes: 10 additions & 9 deletions resources/shaders/objectShader.shader
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ uniform mat4 u_projection;
attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_texcoords;
attribute vec3 a_tangent;
// xyz: tangent. w: bitangent handedness.
attribute vec4 a_tangent;

// Per-vertex outputs
varying vec3 v_normal;
varying vec2 v_texcoords;
varying vec3 v_tangent;
varying vec4 v_tangent;

void main()
{
v_normal = normalize((u_model * vec4(a_normal, 0.)).xyz);
v_tangent = normalize((u_model * vec4(a_tangent, 0.)).xyz);
v_tangent = vec4(normalize((u_model * vec4(a_tangent.xyz, 0.)).xyz), a_tangent.w);
vec4 modelview_position = u_view * u_model * vec4(a_position, 1.);

v_texcoords = a_texcoords;
gl_Position = u_projection * modelview_position;
}
Expand All @@ -48,18 +49,18 @@ uniform sampler2D u_normalMap;
// Per-fragment inputs
varying vec3 v_normal;
varying vec2 v_texcoords;
varying vec3 v_tangent;
varying vec4 v_tangent;

void main()
{
vec3 n = v_normal;
#ifdef NORMAL
vec3 bitangent = cross(v_tangent, n);
mat3 TBN = mat3(normalize(v_tangent), normalize(bitangent), normalize(n));
n = normalize(TBN * (texture2D(u_normalMap, v_texcoords.st).rgb * 2.0 - 1.0));
vec3 bitangent = cross(n, v_tangent.xyz) * v_tangent.w;
mat3 TBN = mat3(normalize(v_tangent.xyz), normalize(bitangent), normalize(n));
n = normalize(TBN * (texture2D(u_normalMap, v_texcoords.st).rgb * 2.0 - 1.0));
#endif
float intensity = max(0.1, dot(u_ambientLightDirection, n));

vec4 base = texture2D(u_baseMap, v_texcoords.st);
#ifdef ILLUMINATION
vec4 illumination = texture2D(u_illuminationMap, v_texcoords.st);
Expand Down
4 changes: 2 additions & 2 deletions scripts/api/modelData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ end
--- Optional; if omitted, no normal map is applied.
--- Valid values include PNG- or JPG-format images relative to the resources/ directory, or paths defined within a resource pack loaded from the packs/ directory.
--- Example:
--- model:setNormalMap("space_station_1/space_station_1_normal.jpg") -- loads this texture from a resource pack
--- model:setNormalMap("mesh/ship/Ender Battlecruiser_normal.png") -- loads this texture from the resources/ directory
--- model:setNormalMap("space_station_1/space_station_1_normal.png") -- loads this texture from a resource pack
--- model:setNormalMap("mesh/ship/my_ship_normal.png") -- loads this texture from the resources/ directory
function ModelData:setNormalMap(texture)
if self.mesh_render == nil then self.mesh_render = {} end
self.mesh_render.normal_texture=texture
Expand Down
Loading
Loading