QuestionSolvedv:SetMaterial HELP

Posts 1–7 of 7 · Page 1 of 1
v:SetMaterial HELP
So im trying to make a models/wireframe and models/debug/debugwhite mix up. Like the wireframe would be blue and debug woule be white, idk i just think it looks nice.

Anyways, I tried render.setmaterialoverride and v:SetMaterial but i can only set one material. How do i set 2 materials?

Im kinda going for falcos smalls scripts chams kinda lookalike.



Heres a picture of it. Its an attatchment.

Please dont come in here to post shittalk.


Moved to the correct section.
You'd have to edit the material itself i.e. changing debugwhite or the wireframe material.
Code:
local debugWhite = Material("models/debug/debugwhite")
local wireFrame = Material("models/wireframe")
local function playerChams(player)
	cam.Start3D()
	render.SuppressEngineLighting(false)
	render.SetColorModulation(1, 0, 0)
	render.MaterialOverride(debugWhite)
	cam.IgnoreZ(true)
	player:DrawModel()
	render.SetColorModulation(0, 0, 1)
	render.MaterialOverride(wireFrame)
	player:DrawModel()
	cam.IgnoreZ(false)
	render.SetColorModulation(0, 0, 0)
	render.SuppressEngineLighting(true)
	cam.End3D()
end

local function RenderScreenspaceEffects()
	local everyPlayer = player.GetAll()
	for i = 1, #everyPlayer do
		local player = everyPlayer[i]
		
		if (player == nil) then
			continue 
		end
		
		if (!IsValid(player)) then
			continue
		end
		
		if (player:IsDormant()) then
			continue
		end
		
		playerChams(player)
	end
end

hook.Add("RenderScreenspaceEffects", "", RenderScreenspaceEffects)
this works fine, remember to cache the materials before using them
Quote Originally Posted by eth0s View Post
Code:
local function playerChams(player)
	cam.Start3D()
	render.SuppressEngineLighting(false)
	render.SetColorModulation(1, 0, 0)
	render.MaterialOverride(Material("models/debug/debugwhite"))
	cam.IgnoreZ(true)
	player:DrawModel()
	render.SetColorModulation(0, 0, 1)
	render.MaterialOverride(Material("models/wireframe"))
	player:DrawModel()
	cam.IgnoreZ(false)
	render.SetColorModulation(0, 0, 0)
	render.SuppressEngineLighting(true)
	cam.End3D()
end

local function RenderScreenspaceEffects()
	local everyPlayer = player.GetAll()
	for i = 1, #everyPlayer do
		local player = everyPlayer[i]
		
		if (player == nil) then
			continue 
		end
		
		if (!IsValid(player)) then
			continue
		end
		
		if (player:IsDormant()) then
			continue
		end
		
		playerChams(player)
	end
end

hook.Add("RenderScreenspaceEffects", "", RenderScreenspaceEffects)
this works fine, remember to cache the materials before using them
tells him to cache the materials but doesn't show in his code

why
Seems this has been solved.

/Closed.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us