Page 15 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 4:10 am
by furi
Zilarrezko wrote:
DaedalusYoung wrote:192.168.0.0 is the ip address for your router. You can only connect to other computers on the home network with this. You will need to open and/or forward the appropriate port in your router's configuration if you want the internet to be able to connect to your computer. Additionally, you may need to disable the firewall on the same port.
Okay so, I use the 192.168? yadda yadda? or use the one i've been using... which is the one you get from this site. But I know how to portforward, that's not hard. Is there a recommended port to forward? or shall I just choose my own?
Use the ipchicken address, and as far as I know, any port that isn't 80 should be fine.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 6:41 am
by rmcode

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 7:39 am
by Zilarrezko
If you explicitly set the filter for each image to say anything other than nearest, nearest... than yes.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 7:40 am
by rmcode
Zilarrezko wrote:If you explicitly set the filter for each image to say anything other than nearest, nearest... than yes.
So it should be enough to set it once in love.load()? Any idea why the sprites look as bad as they do?

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 7:43 am
by DaedalusYoung
Zilarrezko wrote:
DaedalusYoung wrote:192.168.0.0 is the ip address for your router. You can only connect to other computers on the home network with this. You will need to open and/or forward the appropriate port in your router's configuration if you want the internet to be able to connect to your computer. Additionally, you may need to disable the firewall on the same port.
Okay so, I use the 192.168? yadda yadda? or use the one i've been using... which is the one you get from this site. But I know how to portforward, that's not hard. Is there a recommended port to forward? or shall I just choose my own?
192.x.x.x will only work in a private home network, so if you want a friend to connect to you via the internet, you will have to use the ip you find on that (or similar) site.
I think you can choose any port in between 49152 and 65535. All ports below that are reserved (although will still work), if I'm correct.

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Sep 07, 2014 12:59 pm
by IceQB
Hi all.
Im writing my first lighting shader but it doesnt work properly.
Where i made mistake?

Code: Select all


position_x = 0.5  --if i try to use player.x value then screes goes black
position_y = 0.5

extern float position_x;
extern float position_y;

vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords )
   {
vec4 pixel = Texel(texture, texture_coords );
 
float distance = sqrt((position_x-texture_coords.x)*(position_x-texture_coords.x))+((position_y-texture_coords.y)*(position_x-texture_coords.y));

pixel.r = pixel.r - distance;
pixel.g = pixel.g - distance;
pixel.b = pixel.b - distance;

return pixel * color;
}
It presents like that:
Image

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Sep 07, 2014 2:06 pm
by Zilarrezko
try this

Code: Select all

extern float x;
extern float y;
extern float dist;

vec4 effect( vec4 color, Image tex, vec2 tc, vec2 sc )
{
	vec4 pixel;
	float root = sqrt(16*(x-tc.x)*(x-tc.x)/9+(y-tc.y)*(y-tc.y));
	{pixel = Texel(tex, vec2( tc.x, tc.y ) );
	pixel.r = clamp(pixel.r-0.65*root/dist,0,1);
	pixel.g = clamp(pixel.g-0.65*root/dist,0,1);
	pixel.b = clamp(pixel.b-0.65*root/dist,0,1);
	pixel.a = 0.5;}
	return pixel;
}
Pulled it out of one of Ref's posts, I'm assuming you're going for the, only have stuff show up around the player?

In that case, just remember to pass the player's x and y position along with a distance you feel suited to you into the shader through the send function.

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Sep 07, 2014 3:47 pm
by IceQB
I noticed that my shader works properly with rendered single image, but when i put it to the game then doing strange things like on screenshot.
Shader changes sprites, not that what is rendered.

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Sep 07, 2014 9:54 pm
by Zilarrezko
IceQB wrote:I noticed that my shader works properly with rendered single image, but when i put it to the game then doing strange things like on screenshot.
Shader changes sprites, not that what is rendered.
Maybe replace all the texture coords with screen coords,

Eh, just tried it and none of this makes sense in my head. Probably how my textures and their UV's are set up. but I did make some funky looking stuff happen, but nothing that you're looking for. But I've never accomplished anything with shaders. One of the higher ups are going to have to help ya man, sorry.

Re: "Questions that don't deserve their own thread" thread

Posted: Sun Sep 07, 2014 10:45 pm
by IceQB
I think problem isn't shader, look at my map drawing script:

Code: Select all

for y = 1, #map do
		local xy = map[y]
	for x = 1, #xy do
		local number = xy[x]
	local number = xy[x]
		if number ~= 1  then
		
	  love.graphics.draw(tileset, Quads[number], (x-1)*tileW, (y-1)*tileH)
	  
	  
		end
	end
end
Probably problem is combining these two things.