SENT Render Bounds

Check post #3 for details and screenshots

http://www.facepunch.com/threads/1074485-SENT-Render-Bounds?p=28904197&viewfull=1#post28904197

try just doing self:SetRenderBounds(self:OBBMins(), self:OBBMaxs()) instead of the world coordinate one. Or try doubling the renderbounds, or try switching the min and max, on the wiki it says startpos and endpos so not really sure what order they go in, but i’m using max first min second for a shield entity I made.

nvm think I found the problem

[editline]30th March 2011[/editline]

Still have the problem, here’s some screenshots

From this angle every quad seems to be rendered
http://img269.imageshack.us/img269/2926/73698970.th.jpg

Here we can see that the top DrawQuad is not rendered
http://img28.imageshack.us/img28/4099/97078450.th.jpg

if I move my camera inside the wall, the top DrawQuad is rendered but the left one isn’t
http://img197.imageshack.us/img197/374/82669338.th.jpg

This wall seems to be rendering correctly however if I move my camera to the other side it won’t render 1 of the DrawQuad (next screenshot)
http://img827.imageshack.us/img827/8193/36247078.th.jpg

http://img824.imageshack.us/img824/9533/80872849.th.jpg



function ENT:Draw()

	local mins,maxs = self:LocalToWorld(self:OBBMins()), self:LocalToWorld(self:OBBMaxs())
	render.SetMaterial( mat )
	local xOffset,yOffset,pos = -10, -10, self:GetPos()

	if mins.y == maxs.y then
		xOffset = 0	
	else
		yOffset = 0
	end

	self:SetRenderBoundsWS(maxs+Vector(xOffset,yOffset,21), mins+Vector(xOffset*-1,yOffset*-1,-21)) 
	render.DrawQuad(mins+Vector(xOffset,yOffset,20), maxs+Vector(xOffset,yOffset,20), maxs+ Vector(xOffset,yOffset,-20), mins+Vector(xOffset,yOffset,-20))
	render.DrawQuad(mins+Vector(xOffset*-1,yOffset*-1,20), maxs+Vector(xOffset*-1,yOffset*-1,20), maxs+ Vector(xOffset*-1,yOffset*-1,-20), mins+Vector(xOffset*-1,yOffset*-1,-20))
	render.DrawQuad(mins+Vector(xOffset,yOffset,20), maxs+Vector(xOffset,yOffset,20), maxs+ Vector(xOffset*-1,yOffset*-1,20), mins+Vector(xOffset*-1,yOffset*-1,20))



You could always try and create the wall from a mesh.

Just tried with meshes, still have the same problem… I’m pretty sure it has something to do with the sent’s angle and not the renderbounds

I don’t think you need render bounds on meshes.

It depends on where you are doing the mesh code, if it’s inside a entity, then you still need to fix renderbounds, however, doing it in some kinda hook, you shouldn’t need any renderbounds.

Like I said RenderBounds are fine right now. Look at the first picture, the wall that is the farthest from me, it seems to be rendering correctly however when I move my camera to the other side of the wall (last screenshot) the 2 DrawQuads used to draw the sides are not rendered.

bump

[lua]self.Entity:SetRenderBoundsWS(self.Entity:GetPos()+Vector(35, 35, 35), self.Entity:GetPos()-Vector(35, 35, 35))[/lua]
But this is from way back, apparently meshes got overhauled :frowning: still worth a try though

bump, still not fixed

bump :frowning:

bump

have to use local coordinates,
self:SetRenderBounds(-Vector(100,100,100),Vector(100,100,100))