Comments (4)
Lighting is all vertex normals, but I don't see anything obviously wrong in that code.
from space-nerds-in-space.
Interesting. This change makes lighting work again:
diff --git a/snis_client.c b/snis_client.c
index a2b157b..4f57090 100644
--- a/snis_client.c
+++ b/snis_client.c
@@ -1324,7 +1324,7 @@ static int update_planet(uint32_t id, double x, double y, double z, uint8_t gove
m = k % NPLANET_MATERIALS;
scale = planet_scale[s];
e = add_entity(ecx, sphere_mesh, x, y, z, PLANET_COLOR);
- update_entity_scale(e, scale);
+ //update_entity_scale(e, scale);
if (r) {
/* FIXME: attach rings to planets somehow so when a planet is moved
* on the demon screen, the rings do not get left behind.
@@ -12248,6 +12248,7 @@ static void init_meshes()
}
sphere_mesh = mesh_unit_icosphere(4);
+ mesh_scale(sphere_mesh, 700);
planetary_ring_mesh = mesh_fabricate_planetary_ring(2.0, 3.0);
for (i = 0; i < NPLANET_SCALES; i++)
planet_scale[i] = mtwist_int(mt, 400) + 300.0;
So, I thought maybe something about update_entity_scale is broken, so I tried this change, on top of the one above:
diff --git a/snis_client.c b/snis_client.c
index 4f57090..d06ff9a 100644
--- a/snis_client.c
+++ b/snis_client.c
@@ -1324,7 +1324,7 @@ static int update_planet(uint32_t id, double x, double y, double z, uint8_t gove
m = k % NPLANET_MATERIALS;
scale = planet_scale[s];
e = add_entity(ecx, sphere_mesh, x, y, z, PLANET_COLOR);
- //update_entity_scale(e, scale);
+ update_entity_scale(e, 1.0);
if (r) {
/* FIXME: attach rings to planets somehow so when a planet is moved
* on the demon screen, the rings do not get left behind.
Lighting still works. So update_entity_scale does not intrinsically break lighting.
This change, on top of the previous two, breaks lighting again:
diff --git a/snis_client.c b/snis_client.c
index d06ff9a..079d8cc 100644
--- a/snis_client.c
+++ b/snis_client.c
@@ -1324,7 +1324,7 @@ static int update_planet(uint32_t id, double x, double y, double z, uint8_t gove
m = k % NPLANET_MATERIALS;
scale = planet_scale[s];
e = add_entity(ecx, sphere_mesh, x, y, z, PLANET_COLOR);
- update_entity_scale(e, 1.0);
+ update_entity_scale(e, 700.0);
if (r) {
/* FIXME: attach rings to planets somehow so when a planet is moved
* on the demon screen, the rings do not get left behind.
@@ -12248,7 +12248,7 @@ static void init_meshes()
}
sphere_mesh = mesh_unit_icosphere(4);
- mesh_scale(sphere_mesh, 700);
+ mesh_scale(sphere_mesh, 0.5);
planetary_ring_mesh = mesh_fabricate_planetary_ring(2.0, 3.0);
for (i = 0; i < NPLANET_SCALES; i++)
planet_scale[i] = mtwist_int(mt, 400) + 300.0;
Could the triangles be too small, and so the normal calculations get screwed up?
-- steve
from space-nerds-in-space.
I think the problem is in the cubemap lit vertex shader where the normal vector isn't renormalized after getting transformed by the normal matrix. Can't try it at the moment.
from space-nerds-in-space.
Thanks, that fixed it.
-- steve
from space-nerds-in-space.
Related Issues (20)
- There are ghost radio transmissions from dead starbases HOT 1
- snis_client --monitor option has been broken since the SDL2 conversion
- Bug in show_demon_3d() HOT 1
- {request} web interface single computer host HOT 8
- sudo make install - failing with specified parameters HOT 14
- inconsistencies in help function on comms screen HOT 5
- keyboard mappings and interface design for communications station HOT 9
- scan contact velocity is a single number, should be three HOT 6
- keymap & UI/UX: Science! HOT 3
- UX & keymapping wishlist for engineering HOT 5
- missile launch failure HOT 4
- wishlist item for weapon screen: autofire phaser mode HOT 2
- weapons screen wishlist item: zoom HOT 1
- weapons screen wishlist: target specific systems HOT 2
- weapons screen controls request: phaser wavelength hotkeys HOT 1
- helm controls requests HOT 7
- Allow return to lobby from ESC menu HOT 1
- Allow and display keyboard shortcuts in the quit dialogue
- implement conservation of momentum HOT 9
- Fix libglew1.5-dev installation failure; update related documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from space-nerds-in-space.