Comments (6)
public static bool HasSameNodeAndSegmentTextures(NetInfo info, Material nodeMaterial, int texID) {
foreach (var seg in info.m_segments) {
Texture t1 = nodeMaterial.GetTexture(texID);
Texture t2 = seg.m_segmentMaterial.GetTexture(texID);
if (t1 == t2)
return true;
}
return false;
}
FUN FACT: Loading screen mod changes how t1==t2
works in the code above. (I understand loading screen mod tries to minimize memory usage by removing duplicate textures from memory)
- Loading Screen mod is off:
- NExt2 2 lane road with painted median:
t1==t2
is true - 3 lane road with bike lane:
t1==t2
is false
- NExt2 2 lane road with painted median:
- Loading Screen mod is on:
- NExt2 2 lane road with painted median:
t1==t2
is true - 3 lane road with bike lane:
t1==t2
is true
- NExt2 2 lane road with painted median:
from hidecrosswalks.
I just uploaded a hack applying HasSameNodeAndSegmentTextures
code only to NExt2 assets. But I like to find a proper solution.
from hidecrosswalks.
Another difference I found is that:
- NExt2 ELEVATED 2 lane road with painted median texture is 2048 x 1024 (main texture | node and segment texture are identical)
- other roads have 1024 x 1024 texture (both m_nodeMaterial and m_segmentMaterial)
Is that the condition I should be looking for to exempt from hide crossings?
Still don't understand why the segment texture is rendered but node texture is not.
from hidecrosswalks.
Just to be safe side I tested the following on the NExt2 elevated 2 lane road with painted median:
1- if I clone the material but do not do any texture processing, nothing changes.
2- the output of my texture processing has same size as input : 1024 x 2048?
so if texture.width != texture.height
and m_nodeMaterial.MainTexture == m_segmentMaterial.MainTexture
then do not hide crossings. is this the condition I should be looking for?!
from hidecrosswalks.
Ok so roads are a bit weird. There is the diffuse map, the APR map and the XYS map. The APR map is a mask blends asphalt or pavement textures into the diffuse map. In this case, I set the APR map to replace the whole roadway with straight up asphalt. Thus the node and segment diffuse maps are the same but their APR maps are different. The processing you are doing is it different per road or is this a one size fits all programatic change? You can either skip it as it does not have zebra crossings or you could simply change the diffuse texture in the roadway to just black if you are doing manual alterations for each road. I don't remember my rationale for making this intersection without crosswalks. I don't remember if elevated vanilla roads have crosswalks either.
from hidecrosswalks.
@andreharv Sorry for the late response. Thank you so much for the info. This helps me make my code much more reliable.
The processing you are doing is it different per road or is this a one size fits all programatic change?
I blend Alpha map from segment into node. And its all automatic. I'll just make hard coded exceptions for NExt2 roads.
I don't remember my rationale for making this intersection without crosswalks
All NExt2 small/small_heavy ground roads use the same node texture from vanilla small road. You cannot do that for elevated roads because of the size difference between vanilla elevated roads and NExt2 elevated roads. I guess you did not have time to draw crosswalks yourself. or maybe you forgot. bigger elevated roads do not have this size mismatch problem so for bigger roads you can use vanilla crosswalks.
from hidecrosswalks.
Related Issues (16)
- tasks HOT 24
- Benchmarking/performance thread HOT 3
- moving to harmony 2. HOT 1
- Check node is not null
- Bug report HOT 8
- No scrolling in exceptions list HOT 5
- Crosswalks do not hide on Industrial Highway
- Fix road/node texture mismatch on "plain" roads HOT 3
- Possible Compatibly issue with "Garbage bin collector" mod HOT 4
- Detect inverted Asym. Rd. textures
- System.TypeLoadException: Could not load type 'NetworkSkins.Skins.NetworkSkin' HOT 1
- some roads have bad textures HOT 22
- Error in output log HOT 7
- Texture replacement bug HOT 6
- crashes because incompatible mod patches NetNode.RenderInstance HOT 3
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 hidecrosswalks.