You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							754 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							754 B
						
					
					
				
								#pragma kernel EstimateOffsetHist
							 | 
						|
								
							 | 
						|
								uint2 PointCloudRes;
							 | 
						|
								uint OfsHistBinLength;
							 | 
						|
								float BinSize;
							 | 
						|
								
							 | 
						|
								StructuredBuffer<float> PointCloudOfs;
							 | 
						|
								StructuredBuffer<bool> PointCloudMask;
							 | 
						|
								StructuredBuffer<float> OfsMinMax;
							 | 
						|
								
							 | 
						|
								RWStructuredBuffer<uint> OfsHistBinCount;
							 | 
						|
								//RWStructuredBuffer<float> OfsHistBinLeft;
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								[numthreads(1, 1, 1)]
							 | 
						|
								void EstimateOffsetHist(uint3 id : SV_DispatchThreadID)
							 | 
						|
								{
							 | 
						|
									uint i = id.x + id.y * PointCloudRes.x;
							 | 
						|
									float minOfs = OfsMinMax[0];
							 | 
						|
									//float maxOfs = OfsMinMax[1];
							 | 
						|
								
							 | 
						|
									float ofs = PointCloudOfs[i];
							 | 
						|
								
							 | 
						|
									if (PointCloudMask[i])
							 | 
						|
									{
							 | 
						|
										uint hi = (uint)((ofs - minOfs) / BinSize);
							 | 
						|
								
							 | 
						|
										if (hi < OfsHistBinLength)
							 | 
						|
										{
							 | 
						|
											OfsHistBinCount[hi] = OfsHistBinCount[hi] + 1; // OfsHistBinCount[hi]++;
							 | 
						|
											//OfsHistBinLeft[hi] = hi * BinSize + minOfs;
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								}
							 | 
						|
								
							 |