public void ShadersCheck() { string def = CVars.r_good_graphics.ValueB ? "#MCM_GOOD_GRAPHICS" : "#"; s_shadow = Shaders.GetShader("shadow" + def); s_shadowvox = Shaders.GetShader("shadowvox" + def); s_fbo = Shaders.GetShader("fbo" + def); s_fbot = Shaders.GetShader("fbo" + def + ",MCM_TRANSP_ALLOWED"); s_fbov = Shaders.GetShader("fbo_vox" + def); s_fbo_refract = Shaders.GetShader("fbo" + def + ",MCM_REFRACT"); s_fbov_refract = Shaders.GetShader("fbo_vox" + def + ",MCM_REFRACT"); s_shadowadder = Shaders.GetShader("lightadder" + def + ",MCM_SHADOWS"); s_lightadder = Shaders.GetShader("lightadder" + def); s_transponly = Shaders.GetShader("transponly" + def); s_transponlyvox = Shaders.GetShader("transponlyvox" + def); s_transponlylit = Shaders.GetShader("transponly" + def + ",MCM_LIT"); s_transponlyvoxlit = Shaders.GetShader("transponlyvox" + def + ",MCM_LIT"); s_transponlylitsh = Shaders.GetShader("transponly" + def + ",MCM_LIT,MCM_SHADOWS"); s_transponlyvoxlitsh = Shaders.GetShader("transponlyvox" + def + ",MCM_LIT,MCM_SHADOWS"); s_godray = Shaders.GetShader("godray" + def); s_mapvox = Shaders.GetShader("map_vox" + def); s_transpadder = Shaders.GetShader("transpadder" + def); s_finalgodray = Shaders.GetShader("finalgodray" + def); s_finalgodray_toonify = Shaders.GetShader("finalgodray" + def + ",MCM_TOONIFY"); s_finalgodray_lights = Shaders.GetShader("finalgodray" + def + ",MCM_LIGHTS"); s_finalgodray_lights_toonify = Shaders.GetShader("finalgodray" + def + ",MCM_LIGHTS,MCM_TOONIFY"); s_finalgodray_lights_motblur = Shaders.GetShader("finalgodray" + def + ",MCM_LIGHTS,MCM_MOTBLUR"); s_forw = Shaders.GetShader("forward" + def); s_forw_vox = Shaders.GetShader("forward" + def + ",MCM_VOX"); s_forw_trans = Shaders.GetShader("forward" + def + ",MCM_TRANSP"); s_forw_vox_trans = Shaders.GetShader("forward" + def + ",MCM_VOX,MCM_TRANSP"); s_transponly_ll = Shaders.GetShader("transponly" + def + ",MCM_LL"); s_transponlyvox_ll = Shaders.GetShader("transponlyvox" + def + ",MCM_LL"); s_transponlylit_ll = Shaders.GetShader("transponly" + def + ",MCM_LIT,MCM_LL"); s_transponlyvoxlit_ll = Shaders.GetShader("transponlyvox" + def + ",MCM_LIT,MCM_LL"); s_transponlylitsh_ll = Shaders.GetShader("transponly" + def + ",MCM_LIT,MCM_SHADOWS,MCM_LL"); s_transponlyvoxlitsh_ll = Shaders.GetShader("transponlyvox" + def + ",MCM_LIT,MCM_SHADOWS,MCM_LL"); s_ll_clearer = Shaders.GetShader("clearer" + def); s_ll_fpass = Shaders.GetShader("fpass" + def); s_hdrpass = Shaders.GetShader("hdrpass" + def); s_forw_grass = Shaders.GetShader("forward" + def + ",MCM_GEOM_ACTIVE?grass"); s_fbo_grass = Shaders.GetShader("fbo" + def + ",MCM_GEOM_ACTIVE,MCM_PRETTY?grass"); s_forw_particles = Shaders.GetShader("forward" + def + ",MCM_GEOM_ACTIVE,MCM_TRANSP,MCM_NO_ALPHA_CAP?particles"); // TODO: Better place for models? RainCyl = Models.GetModel("raincyl"); RainCyl.LoadSkin(Textures); SnowCyl = Models.GetModel("snowcyl"); SnowCyl.LoadSkin(Textures); }
public PlayerEntity(Region tregion) : base(tregion) { SetMass(tmass); mod_scale = 1.5f; CanRotate = false; EID = -1; model = TheClient.Models.GetModel("players/human_male_004"); model.LoadSkin(TheClient.Textures); CGroup = CollisionUtil.Player; NMTWOWorld.ForceUpdater.Gravity = TheRegion.PhysicsWorld.ForceUpdater.Gravity; NMTWOWorld.TimeStepSettings.MaximumTimeStepsPerFrame = 10; SetPosition(new Location(0, 0, 1000)); }
public void PreHandleSpawn() { model = TheClient.Models.GetModel(mod); model.LoadSkin(TheClient.Textures); int ignoreme; if (mode == ModelCollisionMode.PRECISE) { Shape = TheClient.Models.Handler.MeshToBepu(model.Original, out ignoreme); } else if (mode == ModelCollisionMode.CONVEXHULL) { Shape = TheClient.Models.Handler.MeshToBepuConvex(model.Original, out ignoreme); } else if (mode == ModelCollisionMode.AABB) { List<BEPUutilities.Vector3> vecs = TheClient.Models.Handler.GetCollisionVertices(model.Original); Location zero = new Location(vecs[0]); AABB abox = new AABB() { Min = zero, Max = zero }; for (int v = 1; v < vecs.Count; v++) { abox.Include(new Location(vecs[v])); } Location size = abox.Max - abox.Min; Location center = abox.Max - size / 2; Shape = new BoxShape((float)size.X * (float)scale.X, (float)size.Y * (float)scale.Y, (float)size.Z * (float)scale.Z); Offset = -center; } else { List<BEPUutilities.Vector3> vecs = TheClient.Models.Handler.GetCollisionVertices(model.Original); // Location zero = new Location(vecs[0].X, vecs[0].Y, vecs[0].Z); double distSq = 0; for (int v = 1; v < vecs.Count; v++) { if (vecs[v].LengthSquared() > distSq) { distSq = vecs[v].LengthSquared(); } } double size = Math.Sqrt(distSq); Offset = Location.Zero; Shape = new SphereShape((float)size * (float)scale.X); } }