SENT Render Bounds

Check post #3 for details and screenshots

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

Here we can see that the top DrawQuad is not rendered

if I move my camera inside the wall, the top DrawQuad is rendered but the left one isn’t

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)

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	
		yOffset = 0

	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.


[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:


have to use local coordinates,