<commit_before>var Lines=require('../lines.js');
var Shape=require('./shape.js');

var LodShape=function(elementIndexBits,shaderType,lod){
	Shape.call(this,elementIndexBits,shaderType);
	this.lod=lod;
	var maxLod=this.getMaxPossibleLod();
	if (this.lod.value>maxLod) this.lod.value=maxLod;
	if (this.lod.max>maxLod) this.lod.max=maxLod;
};
LodShape.prototype=Object.create(Shape.prototype);
LodShape.prototype.constructor=LodShape;
LodShape.prototype.getMaxPossibleLod=function(){
	return 6; // TODO abstract? or use *Count fns
};
// abstract LodShape.prototype.getDistinctVertexCount=function(lodSymbol){}; // # of distinct vertices where one vertex can be shared between different faces and output primitives
// abstract LodShape.prototype.getFaceVertexCount=function(lodSymbol){}; // # of distinct (vertex,face) pairs that still can be shared between output primitives
// abstract LodShape.prototype.getTotalVertexCount=function(lodSymbol){}; // # of vertices in output primitives = # of elements when element arrays are in use
// abstract LodShape.prototype.writeStoreShape=function(c,cv){};
LodShape.prototype.writeArraysAndBufferData=function(debugArrays,c,cv){
	var nVerticesFn = this.shaderType=='face'
		? this.getFaceVertexCount
		: this.getDistinctVertexCount;<commit_msg>don't limit lod when not using elements<commit_after>var Lines=require('../lines.js');
var Shape=require('./shape.js');

var LodShape=function(elementIndexBits,shaderType,lod){
	Shape.call(this,elementIndexBits,shaderType);
	this.lod=lod;
	var maxLod=this.getMaxPossibleLod();
	if (this.lod.value>maxLod) this.lod.value=maxLod;
	if (this.lod.max>maxLod) this.lod.max=maxLod;
};
LodShape.prototype=Object.create(Shape.prototype);
LodShape.prototype.constructor=LodShape;
LodShape.prototype.getMaxPossibleLod=function(){ // due to element index type
	if (!this.usesElements() || this.elementIndexBits>=31) { // 1<<31 is a negative number, can't compare with it
		return this.lod.max; // no need to limit lod if elements are not used or index type is large enough
	}
	return 6;
};
// abstract LodShape.prototype.getDistinctVertexCount=function(lodSymbol){}; // # of distinct vertices where one vertex can be shared between different faces and output primitives
// abstract LodShape.prototype.getFaceVertexCount=function(lodSymbol){}; // # of distinct (vertex,face) pairs that still can be shared between output primitives
// abstract LodShape.prototype.getTotalVertexCount=function(lodSymbol){}; // # of vertices in output primitives = # of elements when element arrays are in use
// abstract LodShape.prototype.writeStoreShape=function(c,cv){};
LodShape.prototype.writeArraysAndBufferData=function(debugArrays,c,cv){
	var nVerticesFn = this.shaderType=='face'
		? this.getFaceVertexCount
		: this.getDistinctVertexCount;
{'fraction_non_alphanumeric': 0.12245626561942163, 'fraction_numerical': 0.0024991074616208496, 'mean_word_length': 6.354330708661418, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1513823', 'n_tokens_mistral': 893, 'n_tokens_neox': 852, 'n_words': 196}